Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

For example this one disables function if AdBlock plus is detected, and it works. Is there a way to circumvent this?

share|improve this question
add comment

closed as off topic by Terry Chia, NULLZ, Celeritas, Luc, TildalWave May 31 '13 at 9:14

Questions on Information Security Stack Exchange are expected to relate to Information security within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

There are many scripts and projects to help site owners detect AdBlock Plus, but I think you're interested in how they work.

The idea is simple. The website loads a JavaScript file called ads.js (or any other name that AdBlock Plus finds"attractive"), which contains:

var amIHere = document.createElement("div");
amIHere.setAttribute("id", "amIHere");

If you have AdBlock Plus, then it will block this script from running and the div won't be created. Then they use a normally-named JavaScript file which contains a simple check for the the div's existence

if (document.getElementById('amIHere')){
   alert('You're Alright');
}else{
   alert('You're using AdBlock Plus');
}

Other methods is to load a div with the id ads which AdBlock Plus hides, then with JavaScript check if the div is hidden or not.

This will help you detect the majority of AdBlock Plus users, but because of the nature of this problem (everything happens on the client side), in theory, a user is able to circumvent all of your checks and detectors.

As a "power user", when a website I need to use tells me that I have to disable Adblock Plus, I just disable it and enable it after I finish. I don't really want to spend time and resources to find a way around it. So you can assume that the vast majority of your users won't bother. They will be annoyed that you're forcing them to disable it, but they'll either leave your website or just disable AdBlock Plus.

share|improve this answer
add comment

It is detected using the following or similar: http://adblockdetector.com/

Can it be prevented? You'll need another plugin that rips that code out or if you're trying to block users from blocking your ads, write some code that detects adblock and display the ads in a way that adblock is not yet blocking.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.