Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect active ad blockers #48

Open
da2x opened this issue Jun 29, 2018 · 0 comments
Open

Detect active ad blockers #48

da2x opened this issue Jun 29, 2018 · 0 comments

Comments

@da2x
Copy link

da2x commented Jun 29, 2018

Active ad blocker (class blocker) detection:

var active_blocker_detected = false,
    test = document.createElement('div');
test.innerHTML=' ';
test.className='adsbox';
document.body.appendChild(test);
window.setTimeout(
  function() {
    active_blocker_detected = (test.offsetHeight == 0);
    test.parentNode.removeChild(test);
}, 250);

Separate category of ad blockers (including AdBlock Plus) from those that only block hosts or by URL (Firefox private window, Firefox Focus, Opera content blocker, Safari mobile extension based blockers, Privacy Badger, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant