Last active
September 13, 2021 14:49
-
-
Save scarpent/4e91ef602626a1e88435120bde357356 to your computer and use it in GitHub Desktop.
Better Twitter: Greasemonkey/Tampermonkey script to hide stuff you don't want to see
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 Better Twitter | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove unwanted stuff (promoted, other people's likes, ...) | |
// @author Scott Carpenter | |
// @match https://twitter.com/ | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// @require https://gist.githubusercontent.com/scarpent/ba8e369f1187fa990b98d1f58b2c013d/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js | |
// @grant none | |
// ==/UserScript== | |
function hideNode(jNode) { | |
//jNode.css("background", "yellow"); | |
jNode.hide(); | |
console.log('hide (dismissible)'); | |
} | |
waitForKeyElements (".DismissibleModule", hideNode); | |
waitForKeyElements (".import-prompt", hideNode); // find people you know | |
waitForKeyElements (".wtf-module", hideNode); // who to follow | |
waitForKeyElements (".trends", hideNode); | |
function hideParent(jNode) { | |
//jNode.parent().css("background", "yellow"); | |
jNode.parent().hide(); | |
console.log('hide parent (promoted)'); | |
} | |
waitForKeyElements (".promoted-tweet", hideParent); | |
function hideParentThree(jNode) { | |
//jNode.parent().parent().parent().css("background", "yellow"); | |
jNode.parent().parent().parent().hide(); | |
console.log('hide parent three (liked, follower)'); | |
} | |
waitForKeyElements (".Icon--heartBadge", hideParentThree); | |
waitForKeyElements (".Icon--follower", hideParentThree); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment