Code: Select all
<script>
function adBlockNotDetected() {
//alert('AdBlock is not enabled');
}
// Function called if AdBlock is detected
function adBlockDetected() {
//alert('AdBlock is enabled');
window.location.replace("/cards/empty");
//$(location).attr('href', '/cards/empty')
}
$(document).on('ready page:load', function(event) {
// Function called if AdBlock is not detected
// Recommended audit because AdBlock lock the file 'fuckadblock.js'
// If the file is not called, the variable does not exist 'fuckAdBlock'
// This means that AdBlock is present
if(typeof fuckAdBlock === 'undefined') {
adBlockDetected();
} else {
fuckAdBlock.onDetected(adBlockDetected);
fuckAdBlock.onNotDetected(adBlockNotDetected);
// and|or
fuckAdBlock.on(true, adBlockDetected);
fuckAdBlock.on(false, adBlockNotDetected);
// and|or
fuckAdBlock.on(true, adBlockDetected).onNotDetected(adBlockNotDetected);
}
});
</script>
Thank you.