-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcontent.min.js
31 lines (31 loc) · 1.06 KB
/
content.min.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
var port = chrome.runtime.connect({ name: "yt" });
function onWindowLoad() {
(window.onscroll = function () {
onWindowScroll();
}),
(window.youtubeLastCheck = null),
sendOptionsRequest();
let e = document.documentElement.innerHTML.indexOf("ytp-embed") >= 0;
if (e) {
let n = null,
t = null,
o = /\/watch\?v=([a-zA-Z0-9-_]{1,})">/,
d = document.documentElement.innerHTML.match(o);
2 == d.length && (n = d[1]);
let i = /\/channel\/([a-zA-Z0-9-_]{1,})"/;
2 == (d = document.documentElement.innerHTML.match(i)).length && (t = d[1]);
let l = { channelId: t, videoId: n, category: null, embedded: e };
if (null != l.channelId || null != l.videoId) return sendData(l), !0;
}
if (
-1 ==
document.documentElement.innerHTML.indexOf(
'window["ytInitialPlayerResponse"] = null',
)
) {
sendData(fetchPageInfo(!0, document.documentElement.innerHTML));
}
if (document.documentElement.innerHTML.indexOf('itemprop="channelId"') > -1) {
sendData(fetchPageInfo(!1));
}
var n = document.title.toString(),