Skip to content

A tiny and simple browser library for detecting ad blocker presence. 🔥

License

Notifications You must be signed in to change notification settings

bharathvaj-ganesan/maari.js

Repository files navigation

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>

Usage

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

About

A tiny and simple browser library for detecting ad blocker presence. 🔥

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published