saji / bigger thumbs in anidb

// ==UserScript==
// @name       bigger thumbs in anidb
// @namespace  https://twitter.com/saji_
// @version    0.1
// @description  Show bigger thumbnails on AniDB
// @match      http://anidb.net/*
// @copyright  2013+, Marek ‘saji’ Augustynowicz
// ==/UserScript==

(function () {
    
    var regex = /(^https?:\/\/[a-z0-9\.]+\/pics\/anime\/)thumbs\/[0-9]+x[0-9]+\/([0-9]+\.jpg)-thumb\.jpg$/;
    
    Array.prototype.forEach.call(document.querySelectorAll('.thumb img'), function (img) {
        var match = img.src.match(regex);
        if (match) {
            img.src = match[1] + match[2];
            img.style.maxWidth = '160px';
        }
	});
    
}());