Simon Willison’s Weblog

Subscribe

Fixing MSDN with Greasemonkey

8th January 2005

Site specific browser customisations have been a a recurring theme on this site over the past six months. Thanks to the ever inventive Aaron Boodman that problem is pretty much solved. Greasemonkey is a plugin for Firefox that lets you create user site customisation scripts (.script.js), easily install them in Firefox and then set which sites they should be run on. Michael Moncur has a handy tutorial on getting started.

I’ve already found reason to write my first script. For all of its faults, one thing that can be said for Internet Explorer is that its technical documentation runs rings around its competitors. Safari and Opera have virtually no technical documentation at all, while Mozilla’s is piecemeal to say the least (let’s hope they listen to Jon Udell and Tim Bray). Unfortunately, IE’s documentation is hidden away on the always frustrating MSDN. The good stuff is in the HTML and DHTML reference, but information on which versions (and platforms) of IE can cope with which objects is no where to be found.

Or at least that’s what I thought, until someone on IRC told me to hover over the event box at the bottom of this page. Nothing happened (in Safari), so I tried Firefox and IE5/Mac. Still nothing, so I viewed source and discovered that the platform information is hidden away in a made-up platinfo attribute on the link and revealed using IE/Windows specific JavaScript. Doh!

A few minutes with Greasemonkey and I had a solution: this user script restricted to URLs matching http://msdn.microsoft.com/workshop/author/dhtml/reference/*. It’s not pretty, but it works—and I’m sure it could be made to look quite decent given a little extra effort.

This is Fixing MSDN with Greasemonkey by Simon Willison, posted on 8th January 2005.

Next: I need a new backpack

Previous: map.search.ch

Previously hosted at http://simon.incutio.com/archive/2005/01/08/greasemonkey