Web Development for 2010

Alexander Dickson - Web Developer covering PHP, jQuery / Javascript, XHTML, CSS, more

Solving a problem with a Greasemonkey script

Published on Tuesday, 15th June 2010.

I quickly grew tired of clicking the small next button on the xkcd site, whilst trying to view every comic from the start, in order. I thought "hey, why don't I check out that Greasemonkey thing! This sounds like a perfect excuse."

I knocked up a small Greasemonkey script that turns the comic into the next link, so you can just click the comic to view the next, just like FaceBook and Lightbox variants.

At first, I was tempted to add jQuery and put it together that way. After all, I use jQuery for 99% of DOM manipulation, as it is just that damn easy. But for this, I decided to use the standard DOM API, as I am only coding for Firefox (had I need to support IE, it may have been a different story).

Another thing that was a bit janky is how prone the script is to breaking; but that will mostly be the case when coding something up for a third party site that doesn't provide an API. Since I started reading xkcd in 2007, I can't recall any major site updates. Please drop me a line if it is ever breaks!

So download it, and start viewing xkcd from the begininng! Some of the earlier ones are quite different to his recent work, so grab a beer and put your feet up!

Comments

No comments yet.

Leave a Comment

Comment Details

Your email will never be displayed. If you have a gravatar, it will be displayed.

Note: Your comment may require approval before it is posted to the site.

Stack Overflow Profile

view full profile »

About

I'm a web developer from the Sunshine Coast, Australia. more »