Software As She’s Developed

Mahemoff’s Podcast/Blog – Web, Programming, Usability from the Author of ‘Ajax Design Patterns’ (AjaxPatterns.org)

Software As She’s Developed header image 2

Greasing Greasemonkey Scripts

August 21st, 2005 · 2 Comments · Links, SoftwareDev

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.

Tags: ·····

2 Comments so far ↓

  • Julien Couvreur

    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

  • Julien Couvreur

    Hey Micheal. I modified the z-index in the script like we discussed.

    Also, I got one more script for XmlHttpRequest development in Firefox: http://blog.monstuff.com/archives/000262.html It bypasses the “same domain” check, allowing you to develop a web page locally, while letting it “talk” to the server. This way there is no need to keep deploying the page to test it.

Leave a Comment