Skip to content

Instantly share code, notes, and snippets.

@farhaanbukhsh
Created June 1, 2020 05:06
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 farhaanbukhsh/862040e729dfdff333106e0f8fcdded2 to your computer and use it in GitHub Desktop.
Save farhaanbukhsh/862040e729dfdff333106e0f8fcdded2 to your computer and use it in GitHub Desktop.
This script is a TamperMonkey script that is use to hide the Trending Now Panel. This is mostly to save yourself from the negative trends and keep your mental peace.
// ==UserScript==
// @name Hide Twitter Machine Trends
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Farhaan Bukhsh
// @match https://twitter.com/*
// @grant none
//// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
(function() {
'use strict';
(new MutationObserver(check)).observe(document, {childList: true, subtree: true});
function check(changes, observer) {
if(document.querySelector('[aria-label="Timeline: Trending now"]')) {
observer.disconnect();
var timelineTrending = document.querySelector('[aria-label="Timeline: Trending now"]');;
timelineTrending.style.display="None";
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment