Why copy-paste adblock detection stops working
The public snippets and libraries we checked rely on one of two old families of checks: fake ad elements and test requests. Both are public, so the people who maintain filter lists know them too.
| What happens | What you see | What it costs |
|---|---|---|
| Filter lists add rules that switch well-known detectors off | Nothing. The check still runs and reports no blocker | Your ad-block rate falls while blocking does not |
| Ads are blocked by an office network or a VPN, not by the reader | The same message as someone who installed an extension | A reader who cannot switch it off gets a request they cannot act on |
| Nobody is assigned to keep it current | You notice later, in your ad reports | Upkeep becomes a recurring job on someone's desk |
A published detection script starts ageing the day it ships, and nothing tells you when it stops working. Blocking also comes built into browsers: Brave blocks third-party ads and trackers by default with its own engine, and Firefox includes tracking protection that blocks many ad and analytics domains.
Adblock detection libraries in 2026: where they stand
Four packages you are likely to find on npm. Versions and dates come from npm and GitHub, read on November 1, 2026; BlockAdblock and FuckAdBlock, from our comparison.
| Package | Latest version | Released | Repository |
|---|---|---|---|
| blockadblock | 3.2.1 | March 2016 | Last commit in December 2018 |
| fuckadblock | 3.2.1 | March 2016 | Same project as BlockAdblock; no commit on its main branch since October 2017 |
| just-detect-adblock | 1.1.0 | October 2020 | Describes itself as a copy of BlockAdblock and FuckAdBlock; last commit in October 2020 |
| adblock-detect-react | 1.3.1 | January 2024 | A wrapper for React; last commit in January 2024 |
- BlockAdblock and FuckAdBlock 3.2.1
- blockadblock.com: the technology is sold and its updates stop
- just-detect-adblock 1.1.0
- adblock-detect-react 1.3.1
- Chrome 138 turns off Manifest V2 extensions for everyone, for good
- The last Manifest V2 extensions leave the Chrome Web Store
npm, GitHub and Chrome for Developers, Nov 1, 2026; our BlockAdblock comparison, Oct 11, 2026.
The newest release here is from January 2024. Blockers and filter lists have changed a lot since then, including Chrome turning off Manifest V2 in July 2025, and AdGuard alone publishes hundreds of filter changes a week. A library that ships no releases does not change with them, and many carry bug reports left open for years.
Packages keep being installed long after anyone updates them. On a site that earns from ads, someone has to own the upkeep.
What your code needs from a detection
Your code only cares about the answer. Before you pick a library or a service, ask four questions of what it returns:
- Does it answer on every page, including "no blocker"? Without that, a clean page and a check that never ran look the same.
- Does it say what kind of blocking it found? An extension can usually allow one site; a DNS filter such as Pi-hole usually can't be switched off in one click.
- Does it give the browser family? So your instructions match the reader's browser.
- Is its silence documented? With no answer, your page takes its normal path: fail open.
- Your page Opens as usual
- Our tag Runs the check
- One result Per page
- Your code Decides
| Field | What it tells your code | Values |
|---|---|---|
detected | Whether this page view has a blocker | true, false |
blockerType | The kind of blocking it found | extension, brave_shields, browser_protection, network_dns, unknown |
browser | The browser family, so your message matches it | chromium, firefox, edge, brave, webkit, other |
All fields, in the reference.
Get the result in your JavaScript with the Detection API
The AntiAdBlock Core Detection API is a script mode you choose per site on the Max and Business plans. The same tag runs our multi-signal engine, maintained daily. Nothing appears on screen, and on each page your JavaScript receives one result through the aabc:detection event, the AABC_ON_DETECT callback or the AABC_DETECTION snapshot.
<script>
window.AABC_ON_DETECT = function (result) {
// Your logic here.
};
</script>
<script async
src="https://antiadblockcore.com/s/SITE_ID.js"
data-aabc-site="SITE_ID"
crossorigin="anonymous"></script>1. Your code, before the tag 2. Your tag, from your dashboard
From the Detection API reference. SITE_ID is your site's ID.
Switch the site to Detection API under Script mode in its settings and keep the tag: the reference has each step, and you can test your code without a blocker. The API comes with Max ($12.99 a month) and Business; the Free plan (5,000 detections a month, no payment method) runs the same engine with the wall, so you see your ad-block rate first.
No code at all? In its default mode the tag shows a wall that asks readers to allow your site: see the adblock detector, and the anti-adblock script guide for building versus buying.
Max and Business plans // prices in USD // compare plans
React, Next.js, Vue and WordPress
You do not need a framework package. The result is a plain browser event on window, so any stack can read it.
| Stack | Where the tag goes | Where you read the result |
|---|---|---|
| Any site or CMS | The <head> of every page | A callback or listener placed before the tag |
| React and Next.js | Once; in Next.js, in the head of the root layout | A client component, keeping the last result in state |
| Vue, Svelte or plain JavaScript | Once, in the page's head | Listen for the event and read the snapshot |
| WordPress | The AntiAdBlock Core plugin adds it to every page | Your theme script: the snapshot and the event |
In single-page apps the result arrives when a page is opened or reloaded, not on client-side route changes: keep the last result in your app state. The reference has a React hook and a Google Tag Manager recipe.
The wall, the API or your own code: which fits
| If you want | Use | Start here |
|---|---|---|
| Your code decides what blocked readers see | The Detection API, on Max and Business | Detection API |
| Ask readers to allow your ads, no code | The adblock detector and its wall, from the Free plan | Adblock detector |
| See it working before installing | The live demo, with your own blocker on | Live demo |
| Keep your own snippet | Own the upkeep yourself | Compare with BlockAdblock |
With AntiAdBlock Core, the dashboard shows your ad-block rate and daily activity on every plan; the breakdown by type of blocking comes with Max and Business.
Frequently asked questions
Can JavaScript detect every ad blocker?
No detector can promise every blocker on every browser, and a check written once covers only the blockers it was tested against. AntiAdBlock Core maintains its engine daily, with 99.7% declared detection precision.
Why did my adblock detection stop working without an error?
Most likely a filter list added a rule that switches it off, or your readers' blockers changed. The script keeps reporting that nobody is blocking: your ad-block rate falls while ad revenue does not rise.
Does a reader behind an office network count as an adblock user?
The page is blocked all the same, but that reader usually can't switch it off in one click. The Detection API reports it as its own blocker type, network_dns, so your page can show a short note, or nothing.
Can I detect adblock on the server, or in PHP?
Not on its own. The blocker runs in the visitor's browser or network, so the answer comes from the browser, where the Detection API hands it to your JavaScript. Access rules for paid content belong on your server.
Can I replace a detection library without rewriting my page?
Mostly, yes. Remove the library, add your site's tag or the WordPress plugin, and on Max or Business switch the site to the Detection API. Your callback code moves into window.AABC_ON_DETECT, defined before the tag.
Sources
With the date each one was read.
- Chrome for Developers: Manifest V2 support timeline
- Brave blog: Brave's own ad-blocking engine
- MDN: Firefox tracking protection
- npm registry and GitHub: latest version, release date and last commit of each package
- AdGuard filters repository on GitHub: filter changes per week
- AntiAdBlock Core vs BlockAdblock: the library and the script, source by source
Hand off the check, keep your logic
Try the engine on Free and watch your ad-block rate. When your code is ready, turn on the Detection API for that site on Max or Business.
Prices in USD // see pricing