Greasing Greasemonkey Scripts

Tweaking a Greasemonkey script is easy. It’s just a single file, so you download the file locally, edit it, and install it the same way you’d install any other script.

I did this because I needed a quick fix for the super-helpful XMLHttpRequest Debugging script. Sometimes the console has a little trouble with positioning – using it with Google Maps caused it to sit behind the upper portion of the page due to layering. So I made two quick fixes – increased the z-index in the embedded stylesheet so it would appear in front and also changed the default coordinates (I’d adjusted them with “about:config”, but somehow that wasn’t picked up.)

All in all, I was able to tweak the script, not knowing anything about the GM API, and have it running in my browser in about 10 minutes. Had it been a standard Firefox extension, I would have been out of luck. I’d presumably have to download the original source, set up a dev/testing environment, and be able to package it all up including meta-info. Furthermore, I’d have to restart Firefox to test it, unlike Greasemonkey which works straight away. I’ve never tried all that with extensions, but that’s my perception from a little looking around.

I’m nowhere near as bullish as some about Greasemonkey, at least in the medium-term, as some people, because I think the whole Firefox extension mechanism is way too complex for most end-users, let alone the idea that you have to install Greasemonkey scripts on top of one of those extensions. But in any event, once you have the Greasemonkey extenstion installed, it’s a cinch to remould a script you come across.

0 thoughts on Greasing Greasemonkey Scripts

  1. Thanks for the feedback Michael. Glad the script was useful. Don’t hesitate to send me any tweaks or fix you’ve done.

    With regards to the ease of writing/tweaking Firefox extensions, I totally agree it’s a big selling factor for Greasemonkey. Lots of useful stuff can be written without needing a full extension. And if you want to start something as a Greasemonkey user script, you can generate a standalone extension from it using the Greasemonkey extension compiler, which is pretty cool.

    Cheers, Julien

Leave a Reply