forked from d3ward/toolz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adblock.html
656 lines (595 loc) · 29.9 KB
/
adblock.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="theme-color" content="#161625">
<link rel="apple-touch-icon" sizes="76x76" href="./resources/adblock/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./resources/adblock/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./resources/adblock/favicon-16x16.png">
<link rel="manifest" href="./resources/adblock/site.webmanifest">
<link rel="mask-icon" href="./resources/adblock/safari-pinned-tab.svg" color="#161625">
<link rel="shortcut icon" href="./resources/adblock/favicon.ico">
<meta name="msapplication-TileColor" content="#161625">
<meta name="msapplication-config" content="./resources/adblock/browserconfig.xml">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<title>Ad Blocker Test</title>
<script async defer src="https://aurora-d3.herokuapp.com/public/aurora.js"
aurora-id="520ce98a53142dd933fe4c0f3abb41a0">
</script>
<link rel="stylesheet" href="./src/css/style.css">
<style>
body {
background-color: var(--bg);
background-image: none;
}
main {
padding-top: 6rem;
}
[data-theme=dark],
html,
[data-theme=light] {
--primary: var(--blue);
}
/*------------- Tests section -------------*/
.test {
background-color: var(--bg3);
color: var(--black);
padding: .4rem;
font-weight: bold;
box-shadow: var(--shadow);
border-radius: var(--radius);
text-align: center;
line-height: 60px;
transition: all 1s;
s
}
.testWrap h3,
.testWrap h5,
.test span {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 0;
}
.testWrap>div,
.test>div {
display: flex;
flex-direction: column;
gap: .5rem;
}
.testWrap svg {
height: 25px;
fill: var(--txt);
}
.test>div {
display: none;
}
.test>div>div {
user-select: none;
overflow-x: auto;
border-radius: var(--radius);
white-space: nowrap;
color: var(--black);
box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;
}
.test>span svg {
fill: var(--black);
}
.test.show>div {
display: flex;
}
#bar {
width: 10em;
margin: auto;
}
.rp_text {
color: var(--txt) !important;
}
.cnt2 {
margin: auto;
max-width: 700px;
overflow-y: auto;
}
.cl_info {
margin: auto;
margin-top: 5px;
font-weight: bold;
width: 150px;
padding: 5px;
border-radius: .3rem;
text-align: center;
color: var(--black);
}
/* Toast message */
.toast-message {
position: fixed;
top: -100%;
left: 50%;
transform: translateX(-50%);
background-color: var(--blue);
border-radius: 10px;
width: 400px;
font-size: 16px;
transition: all .5s;
z-index: 9999;
box-shadow: var(--shadow);
}
@media (max-width: 424px) {
.toast-message {
width: calc(100% - 20px);
}
}
.toast-message.success {
background: var(--blue);
}
.toast-message .message {
color: var(--black);
padding: 20px 30px;
text-align: center;
}
/* Loading Wrapper */
.loadingWrap {
height: 100%;
width: 100%;
position: fixed;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: var(--bg);
z-index: 5;
}
.loadingWrap svg {
max-width: 150px;
fill: var(--txt);
}
.loading {
display: flex;
width: 10em;
height: 10em;
margin-top: 3rem;
border: 10px solid transparent;
border-top-color: var(--green);
border-bottom-color: var(--green);
border-radius: 50%;
animation: spin 1.5s linear infinite;
}
#testingInfo {
width: 90%;
background: var(--bg2);
padding: .5rem;
margin: .5rem;
border-radius: .3rem;
}
.loading:before {
content: '';
display: block;
margin: auto;
width: 4em;
height: 4em;
border: 10px solid var(--red);
border-radius: 50%;
animation: pulse 1s alternate ease-in-out infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
._icon {
display: block;
height: 1.6rem;
fill: currentColor;
margin: 0 auto;
}
@keyframes pulse {
from {
transform: scale(0.5);
}
to {
transform: scale(1);
}
}
._notif {
background: var(--primary);
border-radius: var(--radius);
color: var(--txt-r);
margin: 1rem 0;
}
._notif svg {
height: 26px;
fill: currentColor;
}
._notif>span {
display: flex;
align-items: center;
justify-content: flex-end;
}
._notif>div {
padding: 0 1rem;
padding-bottom: 1.5rem;
}
</style>
</head>
<body class="_overflowhidden">
<div class="loadingWrap">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
<path
d="M12.787 29.698c-2.052-1.173-5.508-4.364-7.216-6.664C1.848 18.021-.01 12.477 0 6.418c.005-2.713.165-3.071 1.69-3.776C4.147 1.507 6.935.68 9.827.23c1.967-.307 5.99-.307 7.956 0 3.814.594 8.5 2.205 9.35 3.213.455.542.53 1.201.442 3.903-.077 2.353-.264 3.7-.815 5.891-1.476 5.862-4.997 11.208-9.906 15.04-2.287 1.786-2.996 2.034-4.067 1.421zm1.748-1.842c1.52-1.031 3.765-3.136 5.155-4.832 3.852-4.703 6.089-10.982 6.098-17.124.002-1.364-.046-1.426-1.584-2.038-3.637-1.449-6.481-2.001-10.334-2.007-3.798-.005-6.664.524-10.19 1.88-1.704.655-1.86.837-1.86 2.174.001 6.13 2.232 12.383 6.111 17.13 1.785 2.184 5.173 5.16 5.874 5.16.123 0 .452-.154.73-.343zm-1.928-2.936c-1.83-1.503-4.388-4.402-5.077-5.754-.297-.58-.245-1.232.123-1.542.124-.105.656-.38 1.182-.61l.957-.418.583.537c1.743 1.606 4.489 1.874 6.446.63 1.317-.839 2.356-2.353 2.541-3.704.077-.558.086-.567.745-.712 2.384-.524 2.799-.212 2.118 1.595-1.327 3.523-3.821 7.049-6.765 9.563-1.57 1.34-1.703 1.36-2.853.415zm-6.975-9.816c-.599-.42-1.502-4.042-1.737-6.962-.174-2.17-.108-2.314 1.31-2.86 2.765-1.063 5.24-1.492 8.6-1.492 3.368 0 5.835.429 8.617 1.5 1.382.53 1.489.761 1.306 2.829-.18 2.044-.21 2.07-2.734 2.486-1.02.168-1.872.282-1.892.254a49.76 49.76 0 01-.46-.724c-2.405-3.834-7.973-3.35-9.713.846-.166.403-.277 1.065-.326 1.95l-.074 1.34-1.166.516c-1.321.585-1.342.589-1.73.317z" />
</svg>
<h5>Testing..</h5>
<div id="testingInfo"></div>
<span class="loading"></span>
</div>
<div class="toast-message">
<div class="message">This is an Alert!</div>
</div>
<!-- Modal Box -->
<div class="modal" id="info-modal">
<div>
<header>
<h3></h3>
<button class="close-modal">Close</button>
</header>
<hr>
<div>
<h2>How does it work?</h2>
<b class="_txt-red"><i>You will not see any ads and no trackers will be activated </i></b><br><br>
When you load this website, it will try to establishes connections in pure
Javascript with different urls (advertising, analytics, and social ads services) from a list.<br>
For each host , if the connection fails
it means that the latter has been blocked by your ad-blocker (e.g. uBlock Origin , Blokada , AdGuard ,
in-built adblocker) or DNS provider
<h3>How do I know if my ad blocker is working?</h3>
<p>
You will receive a percentage of how many connections you have blocked
Basically if you get a value <b class="_bg-green _radius _px"> > 40% </b> you are ok as long as you
block ads and analytics category<br>
If you get <b class="_bg-red _radius _px">
< 40%</b> , you're probably not using an <i>effective</i> adblock or
you're not making the most of its potential
</p>
<h2>How i can have 100%</h2>
<p>
You can reach 100 % using a small list that I created to cover all the tests in this website
<button
onclick="copyToClip('https://raw.githubusercontent.com/d3ward/toolz/master/src/d3host.txt')">Copy
d3Host list to clipboard</button>
<br><br>
<b class="_txt-green"><i>This list and this test is a beta project
I do not take any responsibility if something stops working , example Social apps or your
favorite blog
</i></b>
</p>
<h3>Suggested solutions for ad-blocking</h3>
<div>
<a href="https://adguard.com/" class="btn">Adguard</a>
<a href="https://blokada.org/" class="btn">Blokada </a>
<a href="https://ublockorigin.com/" class="btn">uBlock Origin </a>
<a href="https://nextdns.io/" class="btn">Next DNS</a>
</div>
<p>
<h3>Other tools to test your adblock </h3>
<div class="cnt2">
<a href="https://ipleak.net/" class="btn">IP Leak </a>
<a href="https://blockads.fivefilters.org/" class="btn">Block Ads Test </a>
<a href="https://panopticlick.eff.org/" class="btn">Browser Fingerprint by EEF</a>
<a href="http://raymondhill.net/ublock/tiles1.html" class="btn">Adblock Testing by
raymondhill</a>
<a href="http://raymondhill.net/ublock/popup.html" class="btn">Popup Blocker by
raymondhill</a>
</div>
</p>
</div>
<hr>
<footer>
<button class="close-modal mw-100">
Ok
</button>
</footer>
</div>
</div>
<header class="fixed">
<nav>
<a href="adblock.html">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" fill="currentColor">
<path
d="M12.787 29.698c-2.052-1.173-5.508-4.364-7.216-6.664C1.848 18.021-.01 12.477 0 6.418c.005-2.713.165-3.071 1.69-3.776C4.147 1.507 6.935.68 9.827.23c1.967-.307 5.99-.307 7.956 0 3.814.594 8.5 2.205 9.35 3.213.455.542.53 1.201.442 3.903-.077 2.353-.264 3.7-.815 5.891-1.476 5.862-4.997 11.208-9.906 15.04-2.287 1.786-2.996 2.034-4.067 1.421zm1.748-1.842c1.52-1.031 3.765-3.136 5.155-4.832 3.852-4.703 6.089-10.982 6.098-17.124.002-1.364-.046-1.426-1.584-2.038-3.637-1.449-6.481-2.001-10.334-2.007-3.798-.005-6.664.524-10.19 1.88-1.704.655-1.86.837-1.86 2.174.001 6.13 2.232 12.383 6.111 17.13 1.785 2.184 5.173 5.16 5.874 5.16.123 0 .452-.154.73-.343zm-1.928-2.936c-1.83-1.503-4.388-4.402-5.077-5.754-.297-.58-.245-1.232.123-1.542.124-.105.656-.38 1.182-.61l.957-.418.583.537c1.743 1.606 4.489 1.874 6.446.63 1.317-.839 2.356-2.353 2.541-3.704.077-.558.086-.567.745-.712 2.384-.524 2.799-.212 2.118 1.595-1.327 3.523-3.821 7.049-6.765 9.563-1.57 1.34-1.703 1.36-2.853.415zm-6.975-9.816c-.599-.42-1.502-4.042-1.737-6.962-.174-2.17-.108-2.314 1.31-2.86 2.765-1.063 5.24-1.492 8.6-1.492 3.368 0 5.835.429 8.617 1.5 1.382.53 1.489.761 1.306 2.829-.18 2.044-.21 2.07-2.734 2.486-1.02.168-1.872.282-1.892.254a49.76 49.76 0 01-.46-.724c-2.405-3.834-7.973-3.35-9.713.846-.166.403-.277 1.065-.326 1.95l-.074 1.34-1.166.516c-1.321.585-1.342.589-1.73.317z" />
</svg>
</a>
<ul>
<li>
<a href="https://d3ward.github.io/toolz/">
<svg viewBox="0 0 12.002 12.7" class="_icon" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="prefix__a">
<stop offset="0" stop-color="#fc575e" />
<stop offset="1" stop-color="#f7b42c" />
</linearGradient>
</defs>
<g paint-order="stroke markers fill" stroke-width="10.32">
<path d="M8 4.22c.581-.065 3.977.236 3.961.314L5.19 8.361.034 8.214z"
fill-opacity=".831" />
<path
d="M3.579 4.385C1.42 4.27.047 2.012 0 0h3.982c3.437 0 4.025.013 4.24.044 2.282-.027 3.674 2.286 3.74 4.49M7.38 8.204c2.537.053 4.463 2.109 4.622 4.496l-7.9-.016c-1.18-.019-4.052-1.81-4.068-4.47" />
</g>
</svg>
Toolz - Home
</a>
</li>
<li>
<a class="bmc" target="_blank" href="https://www.buymeacoffee.com/dOWS9cU">
<svg role="img" class="_icon" id="bmac-icon" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24">
<title>Buy Me A Coffee icon</title>
<path
d="M20.216 6.415l-.132-.666c-.119-.598-.388-1.163-1.001-1.379-.197-.069-.42-.098-.57-.241-.152-.143-.196-.366-.231-.572-.065-.378-.125-.756-.192-1.133-.057-.325-.102-.69-.25-.987-.195-.4-.597-.634-.996-.788a5.723 5.723 0 00-.626-.194c-1-.263-2.05-.36-3.077-.416a25.834 25.834 0 00-3.7.062c-.915.083-1.88.184-2.75.5-.318.116-.646.256-.888.501-.297.302-.393.77-.177 1.146.154.267.415.456.692.58.36.162.737.284 1.123.366 1.075.238 2.189.331 3.287.37 1.218.05 2.437.01 3.65-.118.299-.033.598-.073.896-.119.352-.054.578-.513.474-.834-.124-.383-.457-.531-.834-.473-.466.074-.96.108-1.382.146-1.177.08-2.358.082-3.536.006a22.228 22.228 0 01-1.157-.107c-.086-.01-.18-.025-.258-.036-.243-.036-.484-.08-.724-.13-.111-.027-.111-.185 0-.212h.005c.277-.06.557-.108.838-.147h.002c.131-.009.263-.032.394-.048a25.076 25.076 0 013.426-.12c.674.019 1.347.067 2.017.144l.228.031c.267.04.533.088.798.145.392.085.895.113 1.07.542.055.137.08.288.111.431l.319 1.484a.237.237 0 01-.199.284h-.003c-.037.006-.075.01-.112.015a36.704 36.704 0 01-4.743.295 37.059 37.059 0 01-4.699-.304c-.14-.017-.293-.042-.417-.06-.326-.048-.649-.108-.973-.161-.393-.065-.768-.032-1.123.161-.29.16-.527.404-.675.701-.154.316-.199.66-.267 1-.069.34-.176.707-.135 1.056.087.753.613 1.365 1.37 1.502a39.69 39.69 0 0011.343.376.483.483 0 01.535.53l-.071.697-1.018 9.907c-.041.41-.047.832-.125 1.237-.122.637-.553 1.028-1.182 1.171-.577.131-1.165.2-1.756.205-.656.004-1.31-.025-1.966-.022-.699.004-1.556-.06-2.095-.58-.475-.458-.54-1.174-.605-1.793l-.731-7.013-.322-3.094c-.037-.351-.286-.695-.678-.678-.336.015-.718.3-.678.679l.228 2.185.949 9.112c.147 1.344 1.174 2.068 2.446 2.272.742.12 1.503.144 2.257.156.966.016 1.942.053 2.892-.122 1.408-.258 2.465-1.198 2.616-2.657.34-3.332.683-6.663 1.024-9.995l.215-2.087a.484.484 0 01.39-.426c.402-.078.787-.212 1.074-.518.455-.488.546-1.124.385-1.766zm-1.478.772c-.145.137-.363.201-.578.233-2.416.359-4.866.54-7.308.46-1.748-.06-3.477-.254-5.207-.498-.17-.024-.353-.055-.47-.18-.22-.236-.111-.71-.054-.995.052-.26.152-.609.463-.646.484-.057 1.046.148 1.526.22.577.088 1.156.159 1.737.212 2.48.226 5.002.19 7.472-.14.45-.06.899-.13 1.345-.21.399-.072.84-.206 1.08.206.166.281.188.657.162.974a.544.544 0 01-.169.364zm-6.159 3.9c-.862.37-1.84.788-3.109.788a5.884 5.884 0 01-1.569-.217l.877 9.004c.065.78.717 1.38 1.5 1.38 0 0 1.243.065 1.658.065.447 0 1.786-.065 1.786-.065.783 0 1.434-.6 1.499-1.38l.94-9.95a3.996 3.996 0 00-1.322-.238c-.826 0-1.491.284-2.26.613z" />
</svg></a>
<a href="https://github.com/d3ward">
<svg class="_icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<title>Github</title>
<path
d="M256,32C132.3,32,32,134.9,32,261.7c0,101.5,64.2,187.5,153.2,217.9a17.56,17.56,0,0,0,3.8.4c8.3,0,11.5-6.1,11.5-11.4,0-5.5-.2-19.9-.3-39.1a102.4,102.4,0,0,1-22.6,2.7c-43.1,0-52.9-33.5-52.9-33.5-10.2-26.5-24.9-33.6-24.9-33.6-19.5-13.7-.1-14.1,1.4-14.1h.1c22.5,2,34.3,23.8,34.3,23.8,11.2,19.6,26.2,25.1,39.6,25.1a63,63,0,0,0,25.6-6c2-14.8,7.8-24.9,14.2-30.7-49.7-5.8-102-25.5-102-113.5,0-25.1,8.7-45.6,23-61.6-2.3-5.8-10-29.2,2.2-60.8a18.64,18.64,0,0,1,5-.5c8.1,0,26.4,3.1,56.6,24.1a208.21,208.21,0,0,1,112.2,0c30.2-21,48.5-24.1,56.6-24.1a18.64,18.64,0,0,1,5,.5c12.2,31.6,4.5,55,2.2,60.8,14.3,16.1,23,36.6,23,61.6,0,88.2-52.4,107.6-102.3,113.3,8,7.1,15.2,21.1,15.2,42.5,0,30.7-.3,55.5-.3,63,0,5.4,3.1,11.5,11.4,11.5a19.35,19.35,0,0,0,4-.4C415.9,449.2,480,363.1,480,261.7,480,134.9,379.7,32,256,32Z" />
</svg>
</a>
<div id="info" data-toggle="info-modal" class="nav-item">
<svg class="_icon" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z"
clip-rule="evenodd"></path>
</svg>
</div>
<div class="nav-item theme-toggle">
<span class="light-icon theme-icon">
<svg class="_icon" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
</svg>
</span>
<span class="dark-icon theme-icon">
<svg class="_icon" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
clip-rule="evenodd"></path>
</svg>
</span>
</div>
</li>
</ul>
<button>
<svg aria-hidden="true" version="1.1" viewBox="0 0 24 24">
<line x1="2" y1="4" x2="22" y2="4" id="top" />
<line x1="2" y1="12" x2="22" y2="12" id="middle-down" />
<line x1="2" y1="12" x2="22" y2="12" id="middle-up" />
<line x1="2" y1="20" x2="22" y2="20" id="bottom" />
</svg>
</button>
</nav>
</header>
<main>
<div class="_notif">
<span> <button onclick="closeNotif()">Close <svg fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
clip-rule="evenodd"></path>
</svg></button> </span>
<div>
Thank you all for the support and feedback!<br>
Recently I started to make some changes to the project structure, creating a homepage with all the
tools and soon will be available new test tools and if someone wants, can suggest a new test of any kind
on Github.<br><br>
For newcomers, this is not a test to compete for the most points, it is a tool to use as a reference to
see
how efficient your blocking system is (consider that with some DNS and browsers there may be problems).
</div>
</div>
<div class="card">
<div id="bar"></div>
<div class="cl_info _bg-green">Blocked Hosts</div>
<div class="cl_info _bg-red">Not Blocked</div>
<!-- Trigger/Open The Modal -->
<p>
Click on a test below to see details about urls <br>
Click on a url to copy to clipboard <br>
</p>
</div>
<div id="test" class="testWrap"></div>
<div id="test1" class="testWrap"></div>
<footer class="_bg _radius _aos">
<div class="cnt ">
<div class="grid">
<div>Icons by <b><a href="https://heroicons.dev/">Heroicons</a> (<a
href="https://github.com/tailwindlabs/heroicons/blob/master/LICENSE"
class="_txt-cl">MIT</a>)</b>
</div>
<div>
Designed by Eduard Ursu(<b><a href="https://d3ward.github.io">d3ward</a></b>) © 2021
</div>
<div>
This website use <b><a href="https://www.useaurora.app/">Aurora - Open Web Analytics</a></b>
</div>
<div>
Licensed under <b><a
href="https://creativecommons.org/licenses/by-nc-sa/4.0/">[NC-SA-4.0]</a></b>
</div>
</div>
</div>
</footer>
</main>
<button class="gt-link hide" id="gt-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6">
<path d="M12 6H0l6-6z" /></svg>
</button>
</body>
<script src="./resources/adblock/data.js"></script>
<script src="./src/js/colla.js"></script>
<script src="./src/js/radialprogress.js"></script>
<script src="./src/js/d3Notif.js"></script>
<script src="./src/js/script.js"></script>
<script>
function closeNotif() {
var n = document.querySelector("._notif");
n.remove();
}
//--------------------------------------------------
//Notification toast
var notification = new Notif({
topPos: 10,
classNames: 'success',
autoClose: true,
autoCloseTimeout: 2000
});
//Radial points
var bar = new RadialProgress(document.getElementById('bar'), {
colorBg: "#ff3b3f",
colorFg: "#3cc47c",
colorText: "#202020",
thick: 12
});
var nTest = 0; //Number of url to be tested
const testWrapper = document.getElementById("test"); //Tests wrapper
var points = 0; //Points of blocked urls
//--------------------------------------------------
//Copy to clipboard the str value
function copyToClip(str) {
const el = document.createElement('textarea');
el.value = str;
el.setAttribute('readonly', '');
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild(el);
const selected =
document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;
el.select();
document.execCommand('copy');
$(el).remove();
if (selected) {
document.getSelection().removeAllRanges();
document.getSelection().addRange(selected);
}
notification.showN('URL copied to clipboard !', 'success');
}
//Function to check an url and set red/green result
async function check_url(url, div, parent, np) {
// Lets set up our `AbortController`, and create a request options object
// that includes the controller's `signal` to pass to `fetch`.
const controller = new AbortController()
const config = {
...{
method: 'HEAD',
mode: 'no-cors'
},
signal: controller.signal
}
// Set a timeout limit for the request using `setTimeout`. If the body
// of this timeout is reached before the request is completed, it will
// be cancelled.
const timeout = setTimeout(() => {
controller.abort()
}, 8000);
var hostDiv = document.createElement("div");
if (!np)
nTest += 1;
hostDiv.innerHTML = url;
hostDiv.onclick = () => {
copyToClip(url);
};
div.appendChild(hostDiv);
await fetch(url, config, timeout, parent, div).then(response => {
console.log(response);
$(parent).css("background", "var(--red)");
$(hostDiv).css("background", "var(--red)");
}) //Response was received --> ads are NOT blocked
.catch(error => {
console.log(error.message);
$(hostDiv).css("background", "var(--green)");
if (!np) {
points += 100 / nTest;
bar.setValue(points / 100);
} //No response --> ads are blocked
});
}
//Function to collapse a test
function show_info(t) {
t = t.parentElement;
var others = document.querySelectorAll(".test");;
others.forEach(element => {
if (element != t) $(element).removeClass("show");
});
$(t).toggle("show");
}
// Function to fetch all the tests
async function fetchTests() {
const testingInfoLoading = document.getElementById("testingInfo");
let fetches = [];
for (element in data) {
var catEl = document.createElement("div");
catEl.id = element;
catEl.innerHTML = "<h3>" + icons[element] + " " + element + "</h3>";
testWrapper.appendChild(catEl);
var category = data[element];
var testInfo = document.createElement("div");
var countTests = 0;
for (key in category) {
//Set log test
var div = document.createElement('div');
const dw = document.createElement('div');
div.classList.add("test");
div.id = key;
div.style.background = "var(--green)";
div.innerHTML = "<span onclick='show_info(this)'>" + key + "</span>";
div.appendChild(dw);
catEl.appendChild(div);
if (category.hasOwnProperty(key)) {
var value = category[key];
if (Array.isArray(value)) {
for (let i = 0; i < value.length; i++) {
fetches.push(check_url(value[i], dw, div));
countTests++;
}
} else fetches.push(check_url(value, dw, div));
}
testInfo.innerHTML = "Testing urls => " + element + " | Number of tests => " + countTests;
testingInfoLoading.appendChild(testInfo);
}
}
//Test fetch for the OEMs
var oemTest = document.createElement("div");
oemTest.id = "OEM";
oemTest.innerHTML = "<h3>" + icons["OEM"] +
" OEM </h3><h5> Optional test separated from final points</h5>";
testWrapper.appendChild(oemTest);
for (key in dataOEM) {
var div = document.createElement('div');
const dw = document.createElement('div');
div.classList.add("test");
div.id = key;
div.style.background = "var(--green)";
div.innerHTML = "<span onclick='show_info(this)'>" + icons[key] + " " + key + "</span>";
div.appendChild(dw);
oemTest.appendChild(div);
var value = dataOEM[key];
if (Array.isArray(value)) {
for (let i = 0; i < value.length; i++)
fetches.push(check_url(value[i], dw, div, "np"));
} else fetches.push(check_url(value, dw, div, "np"));
}
let results = await Promise.all(fetches);
return results; //do whatever you want with your results like converting them to json.
}
window.onload = function () {
new navbar();
new themeManager();
new gotop();
new aos();
new modal();
fetchTests().then((result) => {
$(".loadingWrap").fade("out", () => {
console.log("All tests completed");
$("body").removeClass("_overflowhidden");
});
});
}
</script>
</html>