This repository has been archived by the owner on Jan 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-skip.js
73 lines (62 loc) · 2.61 KB
/
auto-skip.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
65
66
67
68
69
70
71
72
73
// TODO: flexible by data object
function init() {
const TIMEOUT = 300;
const hostname = document.location.hostname;
const urls = [
".youtube.",
".twitch.",
".naver.",
".vlive.",
".jobplanet.",
".kakao.",
".afreecatv.",
".dailymotion.",
".jtbc.",
".netflix."
];
if (urls.some(url => hostname.includes(url))) {
if (hostname.includes(".kakao.")) {
if (!hostname.includes("kauth.kakao.com")) {
document.domain = "kakao.com";
}
}
setInterval(callback, TIMEOUT);
}
}
function callback() {
const autoSkipDisable = getCookie("AutoSkipDisable");
if (autoSkipDisable === "true") {
return;
}
const youtube = document.querySelector(".videoAdUiSkipButton") || document.querySelector(".ytp-ad-skip-button");
const youtube2 = document.querySelector(".ytp-ad-overlay-close-button");
const twitch = document.querySelector(".player-video iframe");
const naver = document.querySelector(".u_rmc_btn_skip") || document.querySelector(".skipBtn");
const vlive = document.querySelector(".btn_skip");
const jobplanet = document.querySelector("#extensionSkip") || document.querySelector("#video_ad iframe")
&& document.querySelector("#video_ad iframe").contentWindow.document.querySelector(".skip");
const kakao = document.querySelector("#player_iframe iframe") &&
document.querySelector("#player_iframe iframe").contentWindow.document.querySelector("#adSkipBtn");
const afreeca = document.querySelector("#promotion_btn_skip");
const dailymotion = document.querySelector(".np_ButtonAdSkip");
const jtbc = document.querySelector(".vast-skip-button");
const netflix = document.querySelector(".watch-video--skip-content");
const netflix2 = document.querySelector(".watch-video--skip-content-button");
const chA = document.querySelector("button.vjs-skip-module");
youtube && youtube.click();
youtube2 && youtube2.click();
jtbc && jtbc.click();
netflix && netflix.click();
netflix2 && netflix2.click();
chA && chA.click();
twitch && ((twitch.src = "") || twitch.remove());
naver && (naver.style.display !== "none" && naver.click() || (naver.style.display = "none"));
vlive && vlive.click();
jobplanet && jobplanet.click();
kakao && (~kakao.className.indexOf("hide") && kakao.click() || (kakao.className += "hide"));
afreeca && (afreeca.style.display !== "none" && afreeca.childElementCount === 1 && afreeca.click());
dailymotion && dailymotion.click();
}
(function () {
init();
})();