Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 669 Bytes

README.md

File metadata and controls

19 lines (17 loc) · 669 Bytes

Browser Adblock Detection

A script I've wrote in order to detect if adblock is active on a browser :-)

Usage:

To use this repo, simply pullt the repo into your project and insert the following javascript in your page:

<script type = "text/javascript">
    var adblockCallback = function(isBlocked){
        if(isBlocked){
            alert("You have adblock enabled");
        } else {
            alert("Adblock is off");
        }
    };
</script>
<script type="text/javascript" src = "./ab-detect/js/test.js" class = "adBlockTest"></script>

Note: remember to edit the adblockCallback to do what you need once the detection is finished!