Last active
April 3, 2020 18:54
-
-
Save shpedoikal/acfb151a5f91ea8b50f62d8acb1fe5d0 to your computer and use it in GitHub Desktop.
Delete promoted tweets greasemonkey script
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 Delete promoted tweets | |
// @namespace kyoder | |
// @include *mobile.twitter.com/* | |
// @include *m.twitter.com/* | |
// @include *.twitter.com/* | |
// @include http://twitter.com/* | |
// @include https://twitter.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function killit() | |
{ | |
var kills = document.getElementsByTagName("span"); | |
for(var i = 0; i < kills.length; i++) | |
{ | |
if (kills.item(i).innerHTML == "Promoted") | |
kills.item(i).parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = "none"; | |
} | |
} | |
window.onscroll = killit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated. Too many
.parentNode
s were deleting all posts on user pages.