Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

up vote 24 down vote accepted

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 div's existence

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

Other methods is to load a div with the id ads or that has a class text-ads which AdBlock Plus detects as ads and tries to hide, then using 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
About the method to check the div's visibility, ABP seems to be clever enough to hide it and it still returns a display = block. On chrome I get a display = none. Great, thank you. – daVe Oct 15 '15 at 17:40
@daVe ABP really is "clever enough to hide it and it still returns a display = block"? – Geremia May 25 at 23:25
@Geremia I don't know why. It's maybe a firefox behavior. My solution was to define a var inside ads.js, and check it outside. – daVe May 27 at 8:22

It is detected using the following or similar:

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

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