>>16
There should be an
<a> tag between
<span> and
<img>, which would explain why the expression returned no images.
In any case, instead of using the above script, give this one a try.
// ==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.UNORDERED_NODE_ITERATOR_TYPE, null);
var img = images.iterateNext();
while (img) {
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")]);
img = images.iterateNext();
}
})();
Oh, and remove the semicolon after
@include ... in case Shiichan adds one again. I'M NOT FALLING FOR IT A SECOND TIME!