-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbackground.js
46 lines (31 loc) · 868 Bytes
/
background.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
(function() {
var url = window.location.href.toString().trim();
if (url.indexOf('youtube.com') == -1) {
return;
}
console.log("YouTube Auto Like Started - I Love Cristo <3");
var intervalRunning = false;
var interval = setInterval(function() {
if (intervalRunning == false) {
intervalRunning = true;
var els = document.querySelectorAll('#segmented-like-button button');
if (els)
if (els[0])
for (var a=0; a<els.length; a++) {
if (els[a]) {
var item = '';
if (els[a].innerHTML) {
item = els[a].innerHTML;
item = item.toString().toLowerCase();
}
if (els[a].getAttribute('aria-pressed') == 'false') {
els[a].click();
console.log("Liked!");
}
break;
}
}
intervalRunning = false;
}
}, 100);
})();