Created
June 23, 2022 20:25
-
-
Save brandonhill/0a86dea294ab445570e35815b390f544 to your computer and use it in GitHub Desktop.
Ad blocker detection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// makes dummy ad call, if errored assumes blocker present | |
((d, src) => { | |
const s = d.createElement('script') | |
s.addEventListener('error', () => { | |
console.log('ad blocker present') | |
// tell them how their content theft makes you feel appreciated... | |
}) | |
s.async = true | |
s.src = src | |
d.head.appendChild(s) | |
})(document, '//www.npttech.com/advertising.js') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment