Question: I would like to be able to detect if the user is using adblocking software when they visit my website. If they are using it, I want to display a message asking them to turn it off in order to support the project, like [this website](http://www.playonlinux.com/en/) does.

If you enter to that site and your browser has some kind of adblock software enabled, then the site instead of showing the actual ads shows a little banner telling the users that the ad revenue is used for hosting the project and they should consider turning Adblock off.

I want to do that on my website, I'm using adsense ads on it, How can I do that?

Answer: 
This approach I use on my site, maybe you will find it helpful. In my opinion, it's the **simpliest** solution.

AdBlocker blocks specific classes and html elements, by inspecting these selectors of any blocked ads in developer console (they are all listed) you can see which elements will be always blocked. 

E.g. just inspect this question page on stackoverflow and you will see bunch of blocked ads.

For example, any element with `bottom-ad` class is automatically blocked.

1. I created a non-empty div element with `bottom-ad` class:
`<div class="bottom-ad" style="width: 1px; height: 1px;">HI</div>`
2. After page loads just check if this element is hidden. I used jQuery, but feel free to use javascript:
`$('.bottom-ad').css('display') == "none"` or even better by using `$('.bottom-ad').is(':visible')`

If value is `true`, then AdBlocker is active.
html file

```
<script src="wp-banners.js"></script>

<script>
if(document.getElementById('LavXngdFojBe')){
  alert('Blocking Ads: No');
} else {
  alert('Blocking Ads: Yes');
}
</script>

```

wp-banners.js

```
var e=document.createElement('div');
e.id='LavXngdFojBe';
e.style.display='none';
document.body.appendChild(e);

```

**This is also shown on** <https://detectadblock.com>.