Sunday, January 9, 2005

Grease Monkey

Greasemonkey is a plugin
for firefox that lets you run "user scripts" on particular web pages
automatically. When I last played with "bookmarklets" it occured to
me that it would be useful to have the automatically execute some of
these whenever particular pages are loaded. That's exactly what
grease monkey has done. If you install greasemonkey, you should be able to right-click or control-click on the userscripts to install them.

Combine it with href=http://www.w3schools.com/xpath/xpath_location.asp>xpath and
you have a rather nice system for mucking with web pages. For example, slashdot has some really awful color schemes on some pages. I wrote a greasemonkey userscript to fix slashdot's colors. It does its best to change all existing background colors to the default. This might be doable with a cleverly written user style sheet, but given the lack of element classes in the slash HTML, maybe not.

One of the things that bugs me on a lot of web pages is that there's a
lot of unneeded garbage around the edges. In particular, the
following layout is common:





banner
navcontent



A recent article points out that many folks ignore them anyway.
So, I wrote a couple of userscripts to extract the content section and put it at the top. The remaining "shell" of a page is left at the bottom in case you want it. That part ends up looking weird, but the main content is nicely and more clearly positioned at the top of the page. Here are the userscripts: Weather Underground reorganizer and CNN story reorganizer. Or, if you'd rather just remove the CNN side navbar.

I'll probably write some more of these, which I'll post to this section of my blog. I may also create a better userscripts page, which is for the moment a placeholder that links back here.

Other userscripts I know about, other than those on the greasemonkey site:

No comments:

Post a Comment