Anonymous ID: 28d1dc Feb. 17, 2020, 7:50 a.m. No.8163336   🗄️.is 🔗kun   >>3345

An anon posted this script that will auto block images that you mark as spam. I know it's been around a long time but I hadn't tried it before, and then couldn't find it when I wanted to Reposting in case it helps anyone else. You can paste it into Options-UserJS.

Before and after screenshots attached. When I use this along with certain Comments in Options-Filters, I enjoy life here a lot more. (But a salute to the anti-filter anons out there too, who can stand to look at the same spam in every bread.)

var imageBlacklist = [] ;function loadImageBlacklist() { JSON.parse(localStorage.imageBlacklist || "[]").forEach(addToImageBlaclist); }function saveImageBlacklist() { localStorage.imageBlacklist = JSON.stringify(imageBlacklist); }function addToImageBlaclist(md5) { if (md5 && -1 = imageBlacklist.indexOf(md5)) imageBlacklist.push(md5); }function blacklistPostImages(post) { $(post).find('img.post-image').each(function (i, el) { var md5 = el.getAttribute('data-md5'); addToImageBlaclist(md5); el.remove(); }); }function removeBlacklistedImages() { var removed = 0; $('img.post-image').each(function (i, el) { if (-1 ! imageBlacklist.indexOf(el.getAttribute('data-md5'))) { el.remove(); removed += 1; } }); return removed; }function onNopeClicked(event) { event.preventDefault(); event.stopPropagation(); loadImageBlacklist(); var post = $(event.target).closest('.post'); blacklistPostImages(post); removeBlacklistedImages(); saveImageBlacklist(); }function addNopeButtons() { $('.post').each(function(i, post) { if ($(post).find('.nope').length === 0) { $(post).prepend("<input type='button' class='nope' onClick='onNopeClicked(event)' value='Blacklist'></input>"); } }) }setInterval(function () { loadImageBlacklist(); removeBlacklistedImages(); addNopeButtons(); }, 500);