Last active
March 11, 2024 10:41
-
-
Save Checksum/1f33d9a7dcfbe1c11d6c298d8658288d to your computer and use it in GitHub Desktop.
StopTheMadness user scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove posts marked as "Ad" | |
(() => { | |
const adSel = `[data-testid=placementTracking]` | |
const targetNode = document.querySelector(`body`) | |
const observer = new MutationObserver((mutations) => { | |
for (const m of mutations) { | |
m.addedNodes.forEach(node => { | |
if (ad = node.querySelector(adSel)) { | |
ad.remove(); | |
} | |
}) | |
} | |
}); | |
observer.observe(targetNode, { childList: true, subtree: true }); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment