Skip to content

Commit 83c4bd9

Browse files
authored
Add files via upload
1 parent 92f2105 commit 83c4bd9

File tree

2 files changed

+22
-280
lines changed

2 files changed

+22
-280
lines changed

Diff for: check.js

+1-250
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: index.html

+21-30
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,32 @@
1111
<div id="fab-enabled" style="display: none;">Реклама</div>
1212
<div id="fab-not-enabled" style="display: none;">Нет</div>
1313

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+
1518
<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() {
2320
document.querySelector('#fab-enabled').style.display = 'block';
2421
document.querySelector('#fab-not-enabled').style.display = 'none';
2522
}
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);
3229
} 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);
4731
}
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>
4940

5041
</body>
51-
</html>
42+
</html>

0 commit comments

Comments
 (0)