-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.js
More file actions
25 lines (19 loc) · 1.17 KB
/
content.js
File metadata and controls
25 lines (19 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function hideTweets()
{
var tweets = $( "div [data-you-follow|='false']" ); //Gets all tweets from people you don't follow
for(var i=0;i<tweets.length;i++)
{
if (!tweets[i].hasAttribute("data-retweeter") && !$(tweets[i]).hasClass("descendant") //Checks that it is not a retweet, not a reply to a clicked tweet,
&& !$(tweets[i]).hasClass("js-actionable-user") && !$(tweets[i]).hasClass("my-tweet")) //does not have js-actionable-user class (found via trial and error),
{ //and is not my own tweet
$(tweets[i]).css( "display","none");
if ($(tweets[i]).hasClass("conversation-root")) //If the tweet is part of a conversation, the reply to the conversation must be hidden also
{
$(tweets[i]).parent().next().css("display","none"); //Hides reply to conversation
} //end conversation if
}// end main if
} // end for loop
}//end hideTweets()
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
sendResponse(setInterval(hideTweets,2000));
});