« May 2005 | Main | July 2005 »

June 08, 2005

Greasemonkey - Take Control of Your Web Experience

Greasemonkey is a Firefox extension that allows you to embed DHTML in any web page. For instance, If I type:
javascript:document.images[0].style.display = "none"; void 0;
in the address bar while at http://www.chuckcaplan.com, my most recent mobile photo will disappear (Thanks to fellow Duquesne alumn Ben Schmaus for this example). Taking this a step further, a script could be written to remove the ads from Yahoo! Mail or to do any number of things to enhance your web experience. I personally like some of the scripts written for IMDB.

For my first Greasemonkey script, I stole followed a suggestion by Justin Curtis to remove the ads MapQuest puts on the page when you print directions. The script can be found here. To use this script:

To test it out, go into Tools --> Manage User Scripts and try enabling and disabling my script while on a MapQuest printable directions page. If you refresh, you should see the advertisement either appear or disappear depending on whether or not the script is enabled.

People have written scripts much more complicated than that, some using regular expressions to search for text and some using XPath to search for certain parts of an HTML page. An excellent place to find Greasemonkey scripts is here.

I encourage you to take a look at this technology and start writing scripts to make your surfing more enjoyable. If you come up with anything interesting, let me know.

Posted by Chuck at 09:43 AM | Comments (0) | TrackBack