forked from md-hameem/AdBlocker-Detector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demoSite.html
53 lines (46 loc) · 1.92 KB
/
demoSite.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
51
52
53
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>AdBlock Detector</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/styles/default.min.css">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="center">
<h5 class="notification bg-success" id="adb-not-enabled">AdBlock is disabled</h5>
<h5 class="notification bg-danger" id="adb-enabled">AdBlock is enabled</h5>
</div>
<div class="below">
<input type="button" onclick="history.go(0)" value="Reload Page">
</div>
<script src="adBlockDetector.js"></script>
<script>
// Call the function with the array of URLs and use async/await to wait for the result
(async function() {
const isAdBlocked = await testAdBlocker(adTestUrls);
// Now you can access the updated adBlockerDetected value
//if(debuug){
console.log('Is Ad Blocker Detected:', isAdBlocked);
//}
// Update the page based on the ad blocker detection result
var enabledEl = document.getElementById('adb-enabled');
var disabledEl = document.getElementById('adb-not-enabled');
if (!isAdBlocked) {
enabledEl.style.display = 'none';
disabledEl.style.display = 'block';
} else {
disabledEl.style.display = 'none';
enabledEl.style.display = 'block';
}
// You can also log the updated adBlockerDetected here
if(debuug){
console.log('adBlockerDetected:', adBlockerDetected);
}
})();
</script>
</body>
</html>