-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
176 lines (160 loc) · 4.91 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://atmoner.github.io/Adblock-detector/assets/css/style.css?v=e44666e4ecdcb2af88fc9497d400b5956081edbb" media="screen" type="text/css">
<link rel="stylesheet" href="https://atmoner.github.io/Adblock-detector/assets/css/print.css" media="print" type="text/css">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>Adblock-detector by atmoner</title>
<style>
#container {
position: relative;
width: 600px;
height: 100%;
margin: 0px auto 0 auto;
text-align: center;
}
#messageAdsblocker {
background-color:#F78181;
border:1px solid #DF0101;
padding:5px;
margin-bottom: 30px;
/* arrondi */
-moz-border-radius:7px;
-webkit-border-radius:7px;
border-radius:7px;
}
#messageOk {
background-color:#9FF781;
border:1px solid #31B404;
padding:5px;
margin-bottom: 30px;
/* arrondi */
-moz-border-radius:7px;
-webkit-border-radius:7px;
border-radius:7px;
}
#imageAdsblocker {
position: relative;
}
#image {
position: relative;
left: 0;
top: 0;
/* Préfixes vendeurs */
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
filter: blur(5px);
}
#imagevalueok {
position: relative;
left: 0;
top: 0;
}
#text {
z-index: 100;
position: absolute;
color: red;
font-size: 24px;
font-weight: bold;
left: 170px;
top: 60px;
}
</style>
</head>
<body>
<header>
<div class="inner">
<h1>Adblock-detector</h1>
<h2>Adblock detector for your website</h2>
<a href="https://github.com/atmoner/Adblock-detector" class="button"><small>View project on</small> GitHub</a>
</div>
</header>
<div id="content-wrapper">
<div class="inner clearfix">
<section id="main-content">
<h1 id="welcome-to-github-pages">Demonstration</h1><br />
<div id="container">
<b id="messageAdsblocker" style="display:none">Ads block is detected!</b>
<b id="messageOk" style="display:none">Ads block is not detected!</b>
<div id="imageAdsblocker" style="display:none">
<img id="image" src="https://i.imgur.com/EuQA62x.png" />
<p id="text">
Ads block is detected!
</p>
</div>
<div id="imageOk" style="display:none">
<img id="imagevalueok" src="https://i.imgur.com/EuQA62x.png" />
</div>
</div>
<h2 id="markdown">How to use it?</h2>
<h4>1. Include this content in your footer: <a href="https://raw.githubusercontent.com/atmoner/Adblock-detector/master/adblockDetector.js">adblockDetector.js</a></h4>
<pre class="highlight"><xmp><script src="adblockDetector.js"></script></xmp></pre>
<h4>2. Add this code in your html page:</h4>
<pre class="highlight"><code><xmp><b id="messageAdsblocker" style="display:none">Ads block is detected!</b>
<b id="messageOk" style="display:none">Ads block is not detected!</b>
</xmp></code></pre>
<h4>3. (Optional) Use this css:</h4>
<pre class="highlight"><code><xmp>#messageAdsblocker {
background-color:#F78181;
border:1px solid #DF0101;
padding:5px;
margin-bottom: 30px;
/* arrondi */
-moz-border-radius:7px;
-webkit-border-radius:7px;
border-radius:7px;
}
#messageOk {
background-color:#9FF781;
border:1px solid #31B404;
padding:5px;
margin-bottom: 30px;
/* arrondi */
-moz-border-radius:7px;
-webkit-border-radius:7px;
border-radius:7px;
}</xmp></code></pre>
</section>
<aside id="sidebar">
<p class="repo-owner"><a href="https://github.com/atmoner/Adblock-detector">Adblock-detector</a> is maintained by <a href="https://github.com/atmoner">atmoner</a>.</p>
<p>This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</p>
</aside>
</div>
</div>
<script>
var adBlockEnabled = false;
var debug = true;
var testAd = document.createElement('div');
var returnMessage = document.getElementById('messageAdsblocker');
var returnImage = document.getElementById('imageAdsblocker');
var messageOk = document.getElementById('messageOk');
var imageOk = document.getElementById('imageOk');
testAd.innerHTML = ' ';
testAd.className = 'adsbox';
document.body.appendChild(testAd);
window.setTimeout(function() {
if (testAd.offsetHeight === 0) {
adBlockEnabled = true;
}
testAd.remove();
if (debug)
console.log('AdBlock Enabled? ', adBlockEnabled)
if (adBlockEnabled) {
returnMessage.style.display = 'block';
returnImage.style.display = 'block';
} else {
messageOk.style.display = 'block';
imageOk.style.display = 'block';
}
}, 100);
</script>
</body>
</html>