Detect ad blockers with 1 line of code
Currently detects:
- AdBlock
- Adblock Plus
- Brave
- AdBlocker Ultimate
- AdGuard AdBlock
- 1Block
- Ghostery
- Anti Adblock Detector (w/ AdBlock)
![demo](https://private-user-images.githubusercontent.com/135460135/326719249-0810f962-8fae-4f93-9e45-7a3424c2211a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5MDkyMDMsIm5iZiI6MTcxOTkwODkwMywicGF0aCI6Ii8xMzU0NjAxMzUvMzI2NzE5MjQ5LTA4MTBmOTYyLThmYWUtNGY5My05ZTQ1LTdhMzQyNGMyMjExYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMlQwODI4MjNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wNmZjMzNiYTRjMWJiNzA4MDRlMGEyM2JlZDk5NjRiMWM0MGI4ZmQwMjJjYzNkNzZhMGZlYjJlYzI1Njk3YWYyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.5fdSR5r9-sEpgHQzX1jsmc9JhgrciXTTbFLjf1uThIo)
Demo: https://odddevelopment.github.io/Simple-Adblock-Detector/
-
Add Detector Code:
- Create a JavaScript file with a random name.
- Make the content of the file simpleblocker.js's code.
- Avoid mentioning "ad block" in the file name to prevent it from being blocked by ad blockers.
-
Integrate into Your Site:
- Add the following code on page where ad blockers should be detected:
<script src="myrandomfilename.js"></script>
- Replace "myrandomfilename.js" with your file name.
- Add the following code on page where ad blockers should be detected:
-
Configure Redirect Page:
- Setup the page people get directed to.
- Users are redirected to
./disable-adblock
(ex.https://example.com/disable-adblock
) on this page you can put what you want people with ad blockers to see.
-
Testing:
- Test it out!
- If you have any issues/feedback, get help on the issues page.
-
Support Us: (its free <3)
- If you find this project helpful, consider leaving a ⭐Star as a token of appreciation.