-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyoutubeScript.js
29 lines (28 loc) · 1.02 KB
/
youtubeScript.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
ytPremiumPopupDeleted = false;
document.addEventListener("click", function(event) {
element = event.target
while (true) {
try {
if (element.nodeName.toLowerCase().includes("download")) {
if (!ytPremiumPopupDeleted) {
myTimeout = setInterval(function (params) {
try {
document.querySelector("tp-yt-paper-dialog").remove();
clearInterval(myTimeout);
ytPremiumPopupDeleted = true;
} catch (error) {}
}, 500);
} else {
}
chrome.runtime.sendMessage({url: location.href});
break;
} else {
element = element.parentNode;
}
} catch (error) {
console.log(error);
break;
}
}
});
console.log('[Cobalto] Youtube Script injected! Press the "Download" button on a video to open Cobalto\'s prompt.')