Install NPM Package:
Currently, the following two adblock lists are detected:
- Adblock Plus EasyList: https://github.com/easylist/easylist, the following sub list: easylist_general_block.txt
- uBlock Origin uAssets: https://github.com/uBlockOrigin/uAssets, the following sub list: filters-2022.txt
The library has a tiny size of only 591 bytes and was last tested with the following browsers and Adblock software:
|Browser||Adblock Software||Last Tested||Detection Works?|
|Chrome/220.127.116.11||uBlock Origin v1.44.4||16th Oct 2022||✓|
|Firefox/105.0||uBlock Origin v1.44.4||16th Oct 2022||✓|
|Chrome/18.104.22.168||Adblock Plus v5.1.3||16th Oct 2022||✓|
|Firefox/105.0||AdBlocker Ultimate v3.7.19||16th Oct 2022||✓|
Install the package via npm:
adblockDetector.min.js to your preferred location.
Then you can create a file
demo.html like this:
You can test the functionality of adblock detector locally by opening the
demo.html file in your favorite browser.
The file must be served with a local HTTP server, since adblock detection does not work with the
file:// scheme (because of CORS issues). This is not a problem, because no real website is hosted and accessed via the file scheme.
Start a local server:
python3 -m http.server 8000
Then visit the URL http://localhost:8000/demo.html in your browser.
Installation from Github
Simply clone the repository and then include the library in your website.
Then copy the file
dist/adblockDetector.min.js into your local project.
How does it work?