Last active
April 4, 2024 18:35
-
-
Save JoshuaCWebDeveloper/41cc5b667f7e428842a235dbe74c59f0 to your computer and use it in GitHub Desktop.
Hide Twitter Full Sidebar Trending
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== | |
// @name Hide Trending Articles | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-04-04 | |
// @description try to take over the world! | |
// @author You | |
// @match https://twitter.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com | |
// @grant none | |
// ==/UserScript== | |
(function exec() { | |
'use strict'; | |
try { | |
let parentElement = document.querySelector('[aria-label="Trending"]'); | |
if (parentElement) { | |
parentElement.querySelectorAll('article').forEach((element) => { | |
element.parentElement.parentElement.style.display = 'none'; | |
}); | |
parentElement.querySelectorAll('svg').forEach((element) => { | |
element.parentElement.parentElement.parentElement.style.display = 'none'; | |
}); | |
} | |
} | |
catch (e) { | |
console.error(e); | |
} | |
setTimeout(exec, 1000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment