More actions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<html> | <html> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
function | (function detectAdblockWithInvalidURL(callback) { | ||
var flaggedURL = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'; | |||
if (window.fetch) { | |||
var request = new Request(flaggedURL, { | |||
method: 'HEAD', | |||
mode: 'no-cors', | |||
}); | }); | ||
fetch(request) | |||
.then(function(response) { | |||
if (response.status === 404) { | |||
callback(false); | |||
} | |||
}) | |||
.catch(function(error) { | |||
callback(true); | |||
}); | |||
} else { | |||
var http = new XMLHttpRequest(); | |||
http.open('HEAD', flaggedURL, false); | |||
try { | |||
http.send(); | |||
} catch (err) { | |||
callback(true); | |||
} | |||
if (http.status === 404) { | |||
callback(false); | |||
} | |||
} | |||
})(function(usingAdblock) { | |||
alert("It looks like you're using an ad-blocker!\n\nIf you enjoy our content, please support our site by disabling your adblocker. We depend on ad revenue to keep creating quality content for you to enjoy for free. Ads are necessary to keep the platform free for all.\n\nYou can also disable all ads by activating the subscription in your account. In this way, you will be providing serious financial support to our website. For details, please email us." + usingAdblock); | |||
}) | |||
</script> | </script> | ||
</html> | </html> |
Revision as of 11:34, 16 October 2022