2

I have seen on this question that AdBlock can be detected with something such as

function blockAdblockUser() {
    if ($('.myTestAd').filter(':visible').length == 0) {
        // All are hidden, or "not visible", so:
        // Redirect, show dialog, do something...
    } else if ($('.myTestAd').filter(':hidden').length > 0) {
        // Maybe a different error if only some are hidden?
        // Redirect, show dialog, do something...
    }
}

But, is there any way to detect the type of AdBlock that this person is using?

Community
  • 1
  • 1
MarkusWillson
  • 411
  • 1
  • 3
  • 11
  • 2
    If you're intention is to hide content, then trust me users won't like this. Personally, if I really want to look at the website, I won't hesitate to write a userscript or add more rules to disable whatever ad block detection you have. – simonzack Dec 17 '14 at 21:10
  • @simonzack, no, I do not want to hide content. I just want to see what type of Ad Blocker the user is using. – MarkusWillson Dec 17 '14 at 21:12

1 Answers1

2

Not reliably. Ad blockers are not designed to be easy to detect and differentiate. Furthermore, code running on the client is fundamentally unsafe; a power user can and will subvert it if it bothers them, or if the person developing the ad blocker thinks it might hypothetically be used to bother someone.

You may be able to discern which list of patterns the user is blocking by varying the names of your ads (or using fake "ads" that the blocker might or might not block), but that information will age rapidly, since most such lists are updated frequently. Some of them whitelist fake ads for compatibility reasons.

Community
  • 1
  • 1
Kevin
  • 28,963
  • 9
  • 62
  • 81