Skip to content

Instantly share code, notes, and snippets.

@RicoP
Created September 4, 2012 19:32
Show Gist options
  • Save RicoP/3625430 to your computer and use it in GitHub Desktop.
Save RicoP/3625430 to your computer and use it in GitHub Desktop.
Check if browser uses an adblocker
window.usesNoAdBlocker = true;
<!doctype html>
<html>
<body>
<script type="text/javascript" src="advertisement.js"></script>
<script>
if("usesNoAdBlocker" in window) {
alert("Cool. You are supporting this site :)");
}
else {
alert("Would be realy great if you could support this website.");
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment