-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdemo.html
More file actions
53 lines (48 loc) · 1.98 KB
/
demo.html
File metadata and controls
53 lines (48 loc) · 1.98 KB
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>
<head>
<title>Faibl AdBlocker detection - Example</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="container">
<div class="page-header">
<h1>Faibl AdBlocker detection <small>Example</small></h1>
</div>
<p class="lead">An alert message with your AdBlocker status should be displayed.</p>
<div class="alert alert-info">
Please note that if you try this example on your own servers, you need to clone the related <a target="_blank" href="https://github.com/FaiblUG/faibl_adblocker_detector">git repository</a> and might need to adjust the <b>urlRoot setting</b> to match the location of the cloned repository
</div>
<h2>The example code</h2>
<pre><script>
(function(config) {
var id='faibl_adblock_detector', d = document, js, fjs = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) return;
js = d.createElement('script'); js.id = id; js.src = config.urlRoot+'js/detector.min.js';
js.onload = function() { faiblAdBlockDetector.initialize(config) };
fjs.parentNode.insertBefore(js, fjs);
})({
urlRoot: '/faibl_adblocker_detector/',
callback: function(adBlockerEnabled) {
window.alert('AdBlockerEnabled: ' + (adBlockerEnabled ? 'yes' : 'no'));
}
});
</script></pre>
</div>
<script>
(function(config) {
var id='faibl_adblock_detector', d = document, js, fjs = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) return;
js = d.createElement('script'); js.id = id; js.src = config.urlRoot+'dist/detector-min.js';
js.onload = function() { faiblAdBlockDetector.initialize(config) };
fjs.parentNode.insertBefore(js, fjs);
})({
urlRoot: '/faibl_adblocker_detector/',
callback: function(adBlockerEnabled) {
window.alert('AdBlockerEnabled: ' + (adBlockerEnabled ? 'yes' : 'no'));
}
});
</script>
</body>
</html>