Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wvdschel
Created August 25, 2015 15:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvdschel/020cf58664c59151e02a to your computer and use it in GitHub Desktop.
Save wvdschel/020cf58664c59151e02a to your computer and use it in GitHub Desktop.
Hide promoted tweets greasemonkeyscript
// ==UserScript==
// @name Promoted tweet blocker
// @namespace org.fixnum.tweetblock
// @include https://twitter.com/
// @version 1
// @grant none
// ==/UserScript==
var tweets = document.getElementsByClassName("tweet");
for(tweetIdx = 0; tweetIdx < tweets.length; tweetIdx++) {
var tweet = tweets[tweetIdx];
if(tweet.hasAttribute("data-advertiser-id")) {
tweet.style.display = "none";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment