if (document.images) {
var currImg;
var ImgFound = 0;
var LinkFound = 0;
//alert("checking images..");
for (var d=0; d < document.images.length; ++d) {
currImg = document.images[d];
if (currImg.src.indexOf("banner") > -1) {
ImgFound = 1;
}
}
if (!ImgFound || AdBlockTest) {
if(deny) {
location = "/sorry.html";
window.location(location);
} else {
document.getElementById('warning').style.visibility = 'visible';
}
}
}
Interestingly simple. All the Adblock detection I've seen in the past checked CSS properties of elements surrounding an ad to see if the ad was rendered or not. This implementation requires a separate <img src> tag but I imagine this could be refactored into a (new Image()).src call and have a pure JavaScript solution. Adblock detection |