(() => { 'use strict'; const blockedPaths = [ '1RICxzeoNCAO5NpcRMIgg1XT6fm.jpg', '63viWuPfYQjRYLSZSZNq7dglJP5.jpg', '6fSkhv35nPSw9hwPVCMINQFG1WD.jpg', 'rhr4y79GpxQF9IsfJItRXVaoGs4.jpg', 'jbAvCACjLf1ZG0unB2tdmx5HAf1.jpg', 'rvi2K2Ab4VNBtGaCKaQHxgsUTtB.jpg', '270MrJNqJovumHXGE6SSt0zwUIF.jpg', 'oQXj4NUfS3r3gHXtDOzcJgj1lLc.jpg', ]; function shouldBlockUrl(url) { return url && blockedPaths.some(path => url.includes(path)); } function shouldBlockElement(el) { if (!el) return false; const src = el.getAttribute("src") || ""; const srcset = el.getAttribute("srcset") || ""; return shouldBlockUrl(src) || shouldBlockUrl(srcset); } function removeImageElement(el) { // Attempt to find a meaningful container to remove let container = el.closest("div"); // If that container's grandparent exists, remove grandparent for broader removal if (container && container.parentElement && container.parentElement.parentElement) { console.log("Removing blocked image container:", el.src || el.getAttribute("srcset")); container.parentElement.parentElement.parentElement.remove(); } else { // fallback: remove the element itself el.remove(); console.log("Removing blocked image element directly:", el.src || el.getAttribute("srcset")); } } function checkImages(root = document) { root.querySelectorAll("img, source").forEach(el => { if (shouldBlockElement(el)) { removeImageElement(el); } }); } // Initial scan, delayed to allow lazy loading window.addEventListener('load', () => { setTimeout(() => { checkImages(); }, 1500); }); // Observe dynamically added or changed images/sources const observer = new MutationObserver(mutations => { for (const mutation of mutations) { if (mutation.type === "attributes" && (mutation.attributeName === "src" || mutation.attributeName === "srcset")) { const el = mutation.target; if (shouldBlockElement(el)) { removeImageElement(el); } } else { mutation.addedNodes.forEach(node => { if (node.nodeType === 1) { // Element node if (["IMG", "SOURCE"].includes(node.tagName)) { if (shouldBlockElement(node)) { removeImageElement(node); } } else if (node.querySelectorAll) { checkImages(node); } } }); } } }); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["src", "srcset"] }); console.log("Blocked images filter script initialized."); })();