maari

Detect the presence of ad blocker plugins in browser


Keywords
ad, adblock, adblocker, addetection, adblockerdetection, detectads, adblock-detector, npm
License
MIT
Install
npm install maari@1.0.3

Documentation

Build Status semantic-release Built with Gulp Served with jsdelivr

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);

Callback will be executed if adblock is detected.

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