For Great Justice

This Too Shall Pass

Greasemonkey FTW

Posted on February 11, 2010
Categories: CodeTags: #greasemonkey, #webcomics

// ==UserScript==
// @name           Get Medieval
// @namespace      http://get-medieval.livejournal.com/
// @description    Fixes broken comic images.
// @include        http://get-medieval.livejournal.com/
// ==/UserScript==

var images = document.getElementsByTagName('img');
for (var i in images){
	var src = new String(images[i].src);
	if (src.match(/ainself.net/)){
		if (!src.match(/gif/)){
			src = src + '.gif';
			images[i].src = src;
		}
		break;
	}
}

Yeah, my Javascript sucks, but… yay! I can finish reading the archive again! :)

Comments

Gavin: that code looks soooo familiar.. almost like the one I wrote for work..hrmmm.

Gavin: You should upload it to User Scripts so others can use it too.

ps, why are my gravatars not showing up.

nfg: I’ll take that as a compliment. :) That said, I wrote it from scratch. It took much googling.

And is there gravatar support set up? I didn’t see any plugins, or any settings that looked like they’d enable ‘em.

nfg: Also: http://userscripts.org/scripts/show/68744

Gavin: yea, turns you your gravatar setting (under discussion) is set to ‘G’, and my icon is ‘PG’ :(

nfg: Ah! There. Now your obscene user picture appears. I, sir, am disgusted.