forked from insightbrowser/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
self_block.js
30 lines (29 loc) · 992 Bytes
/
self_block.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
(() => {
var selfBlockPage = function() {
let overlay = document.createElement('div')
overlay.setAttribute('style', `
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
position: fixed; left: 0; top: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.95);
z-index: 2147483647`)
overlay.setAttribute('class', 'adblock')
let overlaytext = document.createElement('div')
overlaytext.setAttribute('style', `
position: absolute; left: 20px; top: 30px;
font-weight: bold;
font-size: 24px;
color:#444;`)
overlaytext.innerText = 'Self-blocked'
overlay.appendChild(overlaytext)
document.body.appendChild(overlay)
}
if (document.readyState === 'complete' || document.readyState === 'interactive') {
selfBlockPage();
} else {
document.addEventListener(
'DOMContentLoaded',
selfBlockPage,
false,
);
}
})();