Hello. Started using the grease script so I could try to reload images when it comes up a mashed potato on bato. It wasn't enough with the existing code. So here is my suggestion. Try assigning a query to the end of the image when forcing reload.
Here is my modified code. used regex replace to enhance the reload. will append ?tro=lo with subsequent lo on each reload. can detect already existing querys in the URL and will append as &tro=lo leaving the existing query intact.
//Force reload the image
function reloadImage(img) {
var src = img.attr("src");
if (img.attr("altsrc") !== undefined) {
var altsrc = img.attr("altsrc");
img.removeAttr("src");
img.attr("altsrc", src);
setTimeout(function () {
img.attr("src", altsrc.replace(/(\.(?:jpg|gif|png|bmp))(\?.*[^tro=lo])?(?:(?:(?:\?|\&)tro=)((?:lo)+)(?:.*))?$/gi,'$1$2?tro=lo$3').replace(/(\.(?:jpg|gif|png|bmp).+)\?([^\?]+)$/gi,'$1&$2'));
img.removeAttr('width');
}, 500);
} else {
img.removeAttr("src");
setTimeout(function () {
img.attr("src", src.replace(/(\.(?:jpg|gif|png|bmp))(\?.*[^tro=lo])?(?:(?:(?:\?|\&)tro=)((?:lo)+)(?:.*))?$/gi,'$1$2?tro=lo$3').replace(/(\.(?:jpg|gif|png|bmp).+)\?([^\?]+)$/gi,'$1&$2'));
img.removeAttr('width');
}, 500);
}
}
Edited by AltTab, 24 February 2016 - 05:38 AM.