Last active
January 27, 2016 02:49
-
-
Save h3ct0rjs/f29ee789d67b0c5c04ad to your computer and use it in GitHub Desktop.
Test of abp adsense blocker, seen in thescienceofcode.azurewebsites.net
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(document).ready( | |
function() { | |
$('#pubadv-accept').on('click', function(){ | |
$('#pubadv').hide(); | |
}); | |
setTimeout(checkAds, 1000); | |
} | |
); | |
function checkAds() { | |
var ad = document.querySelector("ins.adsbygoogle"); | |
if (ad && ad.innerHTML.replace('/\s / g', "").length == 0) { | |
$.ajax({ | |
type: 'post', | |
data: {'value':true}, | |
url: '/Home/PubAdvAccept', | |
success: | |
function(result) { | |
var string = window.location.href.toUpperCase(), substring = "HOME"; | |
if(string.indexOf(substring) == -1) | |
window.location.replace('/Home/Index'); | |
} | |
}); | |
$('#pubadv').show('slow'); | |
$('.pubdiv').html('<div class="alert alert-red"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><h4>¡Importante!</h4><h4>Queremos seguir prestando un servicio gratuito y compartiendo el conocimiento, pero AdBlock está arruinando internet libre. <br/>No queremos cobrar membresías, a cambio te pedimos desactivar tu AdBlock.</h4></div>'); | |
} | |
else{ | |
$.ajax({ | |
type: 'post', | |
data: {'value':false}, | |
url: '/Home/PubAdvAccept' | |
}); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Usage is