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.
If using the new AdSense code, you can do an easy check, with out resorting to content or css checks.

Place your ads as normal in your markup:

```
<ins class="adsbygoogle" style="display: block;"
   data-ad-client="ca-pub-######"
   data-ad-slot="#######"
   data-ad-format="auto"></ins>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>

```

Then you call the adsense code at the **bottom** of your page (note **do not** use the `"async"` flag when calling the `adsbygoogle.js` script):

```
<script src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

```

Then add this little snippit of code below that:

```
<script>
if (!adsbygoogle.loaded) {
   // do something to alert the user
}
</script>

```

AdSense always creates/sets the flag `adsbygoogle.loaded` to `true` when the ads are loaded, You could place the check in a setTimeout function to delay the check by a few seconds.