Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Greasemonkey

Name: Anonymous 2009-03-14 0:01

Hey /prog/

What do I have to change about this greasemonkey script so that when I go to an imagefap page, the thing acutally finishes loading:
http://userscripts.org/scripts/show/15603

I tried removing the timeout at the bottom but then it'll just stop working.

Help me experts.

Name: Anonymous 2009-03-15 10:32

>>19

Fantastic. Thank you so much. Here's the full working Danbooru Expander script.

// ==UserScript==
// @include http://danbooru.donmai.us/post*
// @name Danbooru Expander
// @author Anonymous
// @version 2009-03-15
// @description Enjoy your load times. (absurdres...)
// ==/UserScript==

(function () {
// Find registered posts (JavaScript haxx)
var regexp = /Post.register\(\{(.+?)\}\)/g;
var imageUrls = Object();
var match = regexp.exec(document.body.innerHTML);
while (match) {
    eval("var arr = {" + match[1] + "};");
    imageUrls[arr["preview_url"]] = arr["file_url"];
    match = regexp.exec(document.body.innerHTML);
}

var images = document.evaluate("//span[@class='thumb']/a/img",
    document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

for (var i = 0; i < images.snapshotLength; ++i) {
    var img = images.snapshotItem(i);
    img.removeAttribute("width");
    img.removeAttribute("height");
    img.parentNode.parentNode.style.height = "auto";
    img.parentNode.parentNode.style.width = "auto";
    img.setAttribute("src", imageUrls[img.getAttribute("src")]);
}
})();

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List