Created
April 1, 2026 20:15
-
-
Save adrian154/e9023797004518a56fe0ffdea3eaefb2 to your computer and use it in GitHub Desktop.
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
| // ==UserScript== | |
| // @name Twitter Ad Remover | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Nuke ads | |
| // @author adrian154 | |
| // @match https://x.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; | |
| const removeAds = () => { | |
| [...document.querySelectorAll("span")].filter(s => s.textContent == "Ad").forEach(span => { | |
| let elem = span; | |
| do { | |
| elem = elem.parentElement; | |
| } while(elem.tagName != "ARTICLE"); | |
| elem.style.display = "none"; | |
| console.log("removed ad"); | |
| }); | |
| }; | |
| setInterval(removeAds, 1000); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment