maari
v1.0.3
Published
Detect the presence of ad blocker plugins in browser
Downloads
16
Maintainers
Readme
MAARI JS
A tiny and simple browser library for detecting ad blocker presence. If any of viewers use adblockers just say the swag "senjiruven"
Note: It's famous mass dialogue from South Indian film.
Features
- Simple and Tiny library (Less than 1KB in size)
- Zero Dependency
- Currenty Supports all modern browsers except IE
- CDN support
Getting started
<script src="https://cdn.jsdelivr.net/npm/maari/dist/maari.min.js"></script>
Usuage
const alertUser = () => {
alert('Please turn off the ad blocker');
};
maari(alertUser);
If any adblocker is detected then only the callback will be executed;
FAQ
Why yet another adblock detector library?
There are many adblock detector modules on npm, unfortunately, I couldn't find any that fit my needs:
- Comprehensive test suite
- Covers all browsers atleast except IE
- Unsurprising behavior
- Well-maintained
- Modern logic
The most common problems I noticed in these modules was they are having unncessary logic, following some big list of rules. But the adblockers have become more smart and effective in blocking ads.
License
MIT © Bharathvaj Ganesan