11
11
< div id ="fab-enabled " style ="display: none; "> Реклама</ div >
12
12
< div id ="fab-not-enabled " style ="display: none; "> Нет</ div >
13
13
14
-
14
+ < script > var check = undefined , Check = undefined ; </ script >
15
+
16
+ < script type ="text/javascript " src ="./check.js " integrity ="sha384-vmrf89W3zuYqkqnbA/PTj6JdRUdlShSCo/MHqVej0QoDnucC4ga9bFuW+Z64Um8W " crossorigin ="anonymous "> </ script >
17
+
15
18
< script >
16
- // Function called if AdBlock is not detected
17
- function adBlockNotDetected ( ) {
18
- document . querySelector ( '#fab-enabled' ) . style . display = 'none' ;
19
- document . querySelector ( '#fab-not-enabled' ) . style . display = 'block' ;
20
- }
21
- // Function called if AdBlock is detected
22
- function adBlockDetected ( ) {
19
+ var adBlockDetected = function ( ) {
23
20
document . querySelector ( '#fab-enabled' ) . style . display = 'block' ;
24
21
document . querySelector ( '#fab-not-enabled' ) . style . display = 'none' ;
25
22
}
26
-
27
- // We look at whether BlockAdBlock already exists.
28
- if ( typeof blockAdBlock !== 'undefined' || typeof BlockAdBlock !== 'undefined' ) {
29
- // If this is the case, it means that something tries to usurp are identity
30
- // So, considering that it is a detection
31
- adBlockDetected ( ) ;
23
+ var adBlockUndetected = function ( ) {
24
+ document . querySelector ( '#fab-not-enabled' ) . style . display = 'block' ;
25
+ document . querySelector ( '#fab-enabled' ) . style . display = 'none' ;
26
+ }
27
+ if ( typeof Check === 'undefined' ) {
28
+ document . addEventListener ( "DOMContentLoaded" , adBlockDetected ) ;
32
29
} else {
33
- // Otherwise, you import the script BlockAdBlock
34
- var importFAB = document . createElement ( 'script' ) ;
35
- importFAB . onload = function ( ) {
36
- // If all goes well, we configure BlockAdBlock
37
- blockAdBlock . onDetected ( adBlockDetected )
38
- blockAdBlock . onNotDetected ( adBlockNotDetected ) ;
39
- } ;
40
- importFAB . onerror = function ( ) {
41
- // If the script does not load (blocked, integrity error, ...)
42
- // Then a detection is triggered
43
- adBlockDetected ( ) ;
44
- } ;
45
- importFAB . src = 'https://cdnjs.cloudflare.com/ajax/libs/blockadblock/3.2.1/blockadblock.min.js' ;
46
- document . head . appendChild ( importFAB ) ;
30
+ check . on ( true , adBlockDetected ) . on ( false , adBlockUndetected ) ;
47
31
}
48
- </ script >
32
+ // It removes the variable "fuckadblock" and "FuckAdBlock
33
+ // so that it not be exploited by another script later
34
+ // but beware, you can not use it too!
35
+ check = undefined ;
36
+
37
+ // Do not use FuckAdBlock outside this area
38
+ // (between importing the script and the line above)
39
+ </ script >
49
40
50
41
</ body >
51
- </ html >
42
+ </ html >
0 commit comments