-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
50 lines (44 loc) · 1.11 KB
/
index.html
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
<div id="anti-adblock">
<h2>Please Disable Your Ad Blocker</h2>
<p>We rely on ad revenue to maintain this site. Please consider disabling your ad blocker to support us.</p>
<button id="disable-adblock">Disable Adblock</button>
</div>
<style>
#anti-adblock {
background-color: #f1f1f1;
padding: 20px;
text-align: center;
}
#disable-adblock {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
#disable-adblock:hover {
background-color: #3e8e41;
}
</style>
<script>
var adBlockEnabled = false;
var testAd = document.createElement('div');
testAd.innerHTML = ' ';
testAd.className = 'adsbox';
document.body.appendChild(testAd);
window.setTimeout(function() {
if (testAd.offsetHeight === 0) {
adBlockEnabled = true;
}
testAd.remove();
if (adBlockEnabled) {
var antiAdblock = document.getElementById('anti-adblock');
antiAdblock.style.display = 'block';
var disableAdblock = document.getElementById('disable-adblock');
disableAdblock.onclick = function() {
location.reload();
}
}
}, 100);
</script>