Last active
January 7, 2024 19:39
-
-
Save lumpenspace/f8f25ce8c05d784b023279a029156762 to your computer and use it in GitHub Desktop.
tampermonkeys
This file contains 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==// ==UserScript== | |
// @name Xitter unnagger | |
// @namespace https://lumpenspace.github.io | |
// @version 2024-01-07 | |
// @description Removes premium+ nag and For You tab from twitter/x | |
// @author lumpenspace | |
// @match https://twitter.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com | |
// @grant none | |
// ==/UserScript== | |
const observer = new MutationObserver (() => { | |
const premiumNag = document.querySelector('aside[aria-label="Subscribe to Premium"') | |
const horroTab = document.querySelector('main nav div[role=presentation] a[href="/home"] span') | |
.closest('a[href="/home"]') | |
.remove() | |
[premiumNag, horrorTab].forEach(el => el && el.parentElement.remove()) | |
}) | |
observer.observe(document, {subtree: true, attributes: true, attributeFilter: ['aria-label', "Subscribe to premium"], }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment