>>/11562/
>>/11550/
>>/11552/
prevent shills from annoying anons today
FREEZE ALL TEH GIFS
but don't run untrusted javascript without verifying what it does.
unfortunate side effect is it freezes all gifs, but simply click to enable the animation.
function freeze_gif(i) {
var c = document.createElement('canvas');
var w = c.width = i.width;
var h = c.height = i.height;
c.getContext('2d').drawImage(i, 0, 0, w, h);
try {
i.src = c.toDataURL("image/gif"); // if possible, retain all css aspects
} catch(e) { // cross-domain -- mimic original with all its tag attributes
for (var j = 0, a; a = i.attributes[j]; j++)
c.setAttribute(a.name, a.value);
i.parentNode.replaceChild(c, i);
}
}
function findGifs(f) {
Array.from(imageLinks)
.filter(link => /^.*\.gif$/i.test(link.href))
.map(link => link.querySelector('img'))
.forEach(f)
}
findGifs(freeze_gif);
setInterval(() => findGifs(freeze_gif), 5 * 1000);
credit: freeze_gif() from https://stackoverflow.com/a/4276742