-
Notifications
You must be signed in to change notification settings - Fork 0
/
content_script.js
29 lines (28 loc) · 1.13 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
function core() {
if (window.location.pathname.slice(1, 7) === "shorts") {
storage = new Set()
SHORTS_LIM = 3
TIME = SHORTS_LIM * 50
time = 0
var timerId = setInterval(() => {
const pathName = window.location.pathname.slice(8);
storage.add(pathName);
console.log(storage.size, storage, time);
time += 1
if (time >= TIME || storage.size > SHORTS_LIM) {
clearInterval(timerId);
console.log('size out');
short = document.querySelector("html");
short.innerHTML = "<H1 style='margin: auto auto; background-color:#f00; padding:20px'>ENOUGH SHORTS FOR NOW, GO BACK TO WORK BITCH !</H1>";
short.style.position = "absolute";
short.style.height = '100vh';
short.style.width = '100vw';
short.style.display = 'grid';
short.style.placeItems = 'center';
short.style.backgroundColor = "black"
setTimeout(core, 1000);
}
}, 1000);
} else { setTimeout(core, 1000); }
}
core()