How Ad Blocker Tests Work (The Bait Trick)
The bait-ads technique explained: why a hidden div, a blocked image, and a failed script tell a test exactly which filter layer your ad blocker uses.
Every "test your ad blocker" page on the web — ours included — runs the same trick: it plants fake ads in the page and watches what your blocker does to them. It sounds like a gimmick, but the technique is precise enough to tell you which layer of your blocker is failing. Here is how it works.
Bait one: the element that should vanish
The test drops a <div> into the page with the class names real ads have carried for a decade — adsbox, ad-banner, ad-slot. Cosmetic filter lists match on exactly these names. After a moment, the test checks whether the element still has a height. Zero height or display: none means a cosmetic filter ate it. This is the same check anti-blocker scripts run in reverse to nag you about using a blocker.
Bait two: the image from the wrong neighborhood
The second bait is an ordinary image served from a path like /ads/banner.png. The test registers load and error events. If it errors without a network problem, a URL rule killed the request — no ad-blocker worth using lets /ads/ through.
Bait three: the script that never arrives
The third bait requests a script at an ad-network-style URL. Network filters block the connection before the script loads, which fires the script's error handler. This is the layer that matters most against the big ad networks, because it stops ads before any ad code runs at all.
Why three baits instead of one
Because blockers fail independently by layer. A blocker with expired cosmetic lists but healthy network filters will pass two baits and fail one — a specific, fixable diagnosis that a single yes/no check would flatten into "probably fine". The next time ads creep back onto your favorite site, run the three-bait test before reinstalling anything; the layer that fails points at the fix.
FAQ
Can sites use the same trick to detect my blocker?
Yes, and some do — that is how "please disable your ad blocker" walls work. The technique is symmetric; it detects blockers as easily as it verifies them.
Do these tests work on mobile?
Yes. Safari on iOS with a content blocker, and Android browsers with extension support, all act on the same three layers.