Skip to content

Instantly share code, notes, and snippets.

@Checksum
Last active March 11, 2024 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Checksum/1f33d9a7dcfbe1c11d6c298d8658288d to your computer and use it in GitHub Desktop.
Save Checksum/1f33d9a7dcfbe1c11d6c298d8658288d to your computer and use it in GitHub Desktop.
StopTheMadness user scripts
// 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