-
Notifications
You must be signed in to change notification settings - Fork 2
/
content_script.js
64 lines (56 loc) · 2.24 KB
/
content_script.js
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
$(function () {
setInterval(() => {
chrome.storage.local.get(["running_status_analytics"], function (result) {
if (typeof result.running_status_analytics != "undefined" && result.running_status_analytics != "") {
if (result.running_status_analytics == "start") {
hideAnalyticsOptions();
}
}
});
chrome.storage.local.get(["running_status_comments"], function (result) {
if (typeof result.running_status_comments != "undefined" && result.running_status_comments != "") {
if (result.running_status_comments == "start") {
hideCommentsOptions();
}
}
});
chrome.storage.local.get(["running_status_retweets"], function (result) {
if (typeof result.running_status_retweets != "undefined" && result.running_status_retweets != "") {
if (result.running_status_retweets == "start") {
hideRetweetsOptions();
}
}
});
chrome.storage.local.get(["running_status_likes"], function (result) {
if (typeof result.running_status_likes != "undefined" && result.running_status_likes != "") {
if (result.running_status_likes == "start") {
hideLikesOptions();
}
}
});
}, 100);
});
function hideAnalyticsOptions() {
$first_tweet_li = $('div[data-testid="cellInnerDiv"]').find('article[data-testid="tweet"]');
$first_tweet_li.each(function (index, item) {
$(this).find('a[aria-label][role="link"]').hide();
});
}
function hideCommentsOptions() {
$first_tweet_li = $('div[data-testid="cellInnerDiv"]').find('article[data-testid="tweet"]');
$first_tweet_li.each(function (index, item) {
$(this).find('div[aria-label][data-testid="reply"]').hide();
});
}
function hideRetweetsOptions() {
$first_tweet_li = $('div[data-testid="cellInnerDiv"]').find('article[data-testid="tweet"]');
$first_tweet_li.each(function (index, item) {
$(this).find('div[aria-label][data-testid="retweet"]').hide();
});
}
function hideLikesOptions() {
$first_tweet_li = $('div[data-testid="cellInnerDiv"]').find('article[data-testid="tweet"]');
$first_tweet_li.each(function (index, item) {
$(this).find('div[aria-label][data-testid="like"]').hide();
});
}