XXXLoading Redirector

By gsleblanc Last update Jul 28, 2006 — Installed 2,649 times.
// XXXLoading Redirector 1.0
// Copyright (c) 2006 gsleblanc
//
// This work is licensed under a Creative Commons License
// See http://creativecommons.org/licenses/by-nc-sa/2.5/
//
// ==UserScript==
// @name           XXXLoading Redirector
// @version        1.0
// @namespace      http://userscripts.org/people/7958
// @description    Automatically redirects page to the main image.
// @include        *.xxxloading.com
// ==/UserScript==

(function() {
    var currentLocation = document.location.href;

	// xxxloading.com
   if (currentLocation.match(/^https?:\/\/(.*\.)?xxxloading\.com\/image\.php\?(.*&)?file=.+$/)) {
         var imageElems = document.getElementsByTagName('img');
		 for (var i = 0; i < imageElems.length; i++) {
            if (imageElems[i].getAttribute('onClick') == 'image_mousethingie_zoom(this);') {
                document.location.href = imageElems[i].getAttribute('src');
            }
		}
    }

})();