⛔️ Vanilla JavaScript AdBlock Detector.
Switch branches/tags
Nothing to show
Clone or download
R4meau Merge pull request #4 from ug02fast/master
Converted ES5 and below to ES6 syntax.
Latest commit 93eaebb Nov 3, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Added a license Oct 14, 2016
README.md Add Sponsors section Aug 27, 2017
abDetector.js Converted ES5 and below to ES6 syntax. Nov 1, 2018
abDetector.min.js Removed unnecessary code Oct 10, 2016

README.md

Adblock Detector ⛔️

Simple vanilla JavaScript AdBlock Detector.

Demo

Click here to try it out. Turn on/off your ad blocker and refresh.

How to use it

  • Download/Clone the project, upload the file abDetector.min.js
  • Put this in your <head>:
    • <script type="text/javascript" src="abDetector.min.js"></script>
  • Use this wherever you want to display a message to AdBlock users:
    • <div id="ab-message" style="display: none">Your message here!</div>

You're done!

Notes

  • If you really hate inline styles, you can still style the message in your CSS file.
  • Since it's an element just like any other elements, you can show whatever you want with it (i.e. popups, images…)

Thanks for using my script. If you found any bugs or you think something's wrong, please, file an issue or even better, send me a pull request. I'll be more than happy to check it out.

Don't forget to keep in touch :)

Sponsors

Sponsor

Enjoy.