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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNTU3ODQsIm5iZiI6MTcyNjE1NTQ4NCwicGF0aCI6Ii8xMzU0NjAxMzUvMzI2NzE5MjQ5LTA4MTBmOTYyLThmYWUtNGY5My05ZTQ1LTdhMzQyNGMyMjExYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMlQxNTM4MDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00NTJkODhmZTE4MGI1OTE0MjQzNzdmYTkwNDMwOWRmOWZiOWUzNDkzNzY3OTlhYjAxYzQ0MjRmZGViODk1YTdkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.VPTxhrEaCmwJXkJvEHCs0-0BE3-n2MtaJpluCWnyTv8)
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.