3rd Jun 2005

Posted in

Blog :: Greasemonkey

So lately I've discovered the power of the Greasemonkey extension.  I'm not sure it offers much to the normal user, but if you're a tech savvy internet denizen not afraid to hack a little, (you are using Firefox, right?) then Greasemonkey can improve your browsing experience.  Essentially greasemonkey allows you to add your own custom javascript to a site.  Why would you want to do this?  Glad you asked.

I have a big monitor.  In fact I have two monitors attached to my primary computer, one 19" and one 17".  I rationalize that this lets me keep both my editor and a console window open and visible at the same time, but you and I both know that its really so I can browse the web and watch movies at the same time.  Unfortunately many websites are still using table based layouts with fixed widths.  This means on a big monitor like mine a website might look like this:

Notice all the whitespace on the right?  Only about 1/2 of my browser window actually contains the text that I want to read.  What I'd really prefer (since I'm using tabbed browsing) is to see the "printable" version.  No navigation or ads, and my whole screen is filled with the text I actually want to read.

So it's only one extra click to get to the printable version, but it breaks my flow for reading "article" style sites: go to the index page and open in tabs all the stories I wat to read.  So this script automatically parses the url and navigates to the printable version of the same page when installed as a greasemonkey script.  You have to read the greasemonkyey site to see how to do that, but short story is install greasemonkey in firefox, navigate to the script you want to install, and select "Install user script..." from the tools menu.  Type "http://frontpagemag.com/*" to apply the script to pages at frontpagemag.com.

Now my script is a crude little toy.  That's because my javascript skills range from nonexistent to laughable.  People (and by "people" I mean people who grok javascript and the dom a lot better than I do) are doing amazing things with greasemonkey scripts.  Among other gems are an ajax logging console and a collapsible tree interface to slashdot comments.  There is even an extension to generate a greasemonkey script from your in-the-browser edits of a web page.

Posted on Jun 3rd 2005, 06:35 PM