Seatext library / BotRefund evidence
How to Detect Playwright Bots Using Browser API Inconsistencies
Playwright bots leave detectable traces when they patch or hide browser APIs. By checking for mismatches in navigator properties, permissions, canvas rendering, and WebGL contexts — and cross-referencing those signals against network, device, and...
✓ Built for advertisers who need clear, refund-ready traffic evidence.
Playwright and similar automation frameworks modify browser internals to avoid detection. Those modifications create inconsistencies — missing navigator.webdriver, altered permission states, canvas fingerprint differences, and WebGL context anomalies — that a normal browsing session does not produce. Checking for these mismatches gives you objective evidence of automation, but a single anomaly is not a verdict. Privacy tools, corporate networks, and unusual devices can trigger similar signals for real users. Reliable detection comes from corroborating browser API evidence with independent network, hardware, and behavioral signals.
Why browser API inconsistencies reveal Playwright
Automation tools like Playwright inject initialization scripts that patch or hide standard browser APIs. The goal is to make the automated browser look like a regular user agent. In practice, those patches rarely cover every code path. When the browser is probed from a different angle — an iframe with a clean context, a permission query, a canvas draw operation — the patched APIs can return values that contradict each other or the underlying engine. A real browser runs standard APIs as designed; its built-in properties, permissions, and rendering contexts remain consistent without needing to hide automation.
Key browser API inconsistencies to check
- navigator.webdriver — Playwright often sets this to
falseor removes it, but the property may still exist in unexpected places or return inconsistent types. - Permissions API — Automated browsers may report permission states (notifications, clipboard, camera) that do not match the actual browser chrome or user settings.
- Canvas and WebGL fingerprinting — Drawing operations and context parameters (renderer, vendor, extensions) can differ between a patched automation browser and a genuine one.
- Clean context iframe — Loading a page in an iframe that has not been touched by the automation scripts can expose untouched native APIs that contradict the main frame.
- Init script leftovers — Playwright's initialization scripts may leave traces in
windowproperties, prototype chains, or event handler behaviors that a normal session does not create.
Step-by-step detection implementation
- Collect baseline browser signals — On page load, capture
navigatorproperties,screendetails,performance.timing, and the full list ofnavigator.permissionsqueries. - Run a clean-context probe — Create an
iframewithsandboxattributes that strip the parent's scripts. Inside that iframe, re-query the same APIs. Compare results; mismatches indicate patching. - Execute canvas and WebGL challenges — Draw a defined pattern to a canvas, read back pixel data, and request WebGL context parameters. Hash the outputs and compare against known-good ranges for the claimed browser version.
- Check for init-script artifacts — Enumerate
windowown properties, inspectObject.getOwnPropertyDescriptorsfornavigator,document, andscreen, and look for non-standard getters/setters or frozen properties. - Correlate with network and device signals — Pair the browser evidence with IP reputation, TLS fingerprint (JA3), HTTP/2 settings, device memory, hardware concurrency, and behavioral metrics (mouse movement, scroll patterns, click timing).
- Feed all signals into a scoring model — Weight each independent check. A single browser anomaly adds evidence; multiple independent anomalies across browser, network, and behavior layers raise confidence. BotRefund uses 106 independent checks and sends every signal into a prediction AI that evaluates the complete pattern instead of trusting a raw rule.
Common detection methods and trade-offs
| Method | What it catches | False-positive risk | Implementation effort |
|---|---|---|---|
| navigator.webdriver check | Basic Playwright, Puppeteer, Selenium | Low — but easily spoofed | Trivial |
| Permissions API mismatch | Automation that forgets to patch permissions | Medium — privacy extensions alter permissions | Low |
| Canvas/WebGL fingerprint | Headless or patched rendering paths | Medium — driver/GPU differences affect output | Medium |
| Clean-context iframe probe | Init-script patches that don't propagate to iframes | Low — real browsers stay consistent | Medium |
| Multi-signal correlation (browser + network + behavior) | Sophisticated bots that pass single checks | Low — corroboration filters outliers | High |
Takeaway: Single checks are easy to bypass. A layered approach that cross-checks browser, network, device, and behavior signals — as BotRefund does with 110+ signals — achieves 99% accuracy by weighing the complete pattern.
Building a multi-signal detection system
Start with the browser API checks above. Then add independent layers:
- Network layer: IP reputation, ASN type (datacenter vs residential), TLS fingerprint, HTTP/2 frame ordering.
- Device layer: Hardware concurrency, device memory, battery API, touch support, screen resolution vs viewport consistency.
- Behavioral layer: Mouse trajectory (human tremor vs linear paths), click timing (superhuman <1ms), scroll variance, session duration distribution.
- Attribution layer: Click IDs (GCLID, FBCLID), campaign parameters, referrer chain integrity.
Each layer produces independent evidence. BotRefund keeps every signal as evidence — not a verdict — and cross-checks whether other signals support the same story before its AI prediction model weighs the complete pattern. Across 2,500+ brands audited, 83% of clients recover funds from Google and Meta using reports built in the format platform teams accept.
Verification: how to know your detection works
- Run a controlled Playwright session against your detection script. Confirm each check flags the session.
- Run the same script in a real browser with common privacy extensions (uBlock, Privacy Badger). Verify false-positive rate stays low.
- Test on corporate networks, VPNs, and mobile hotspots. Network-layer signals should not override clean browser signals.
- Log every signal per session. When a platform (Google, Meta) accepts a refund claim, trace which signals contributed. Refine weights accordingly.
Key facts
| Fact | Detail | Source |
|---|---|---|
| Independent checks per session | 106 browser, network, device, and behavior checks | S1 |
| Playwright Init Scripts check purpose | Detects mismatches from automation patching of browser APIs | S1 |
| Single anomaly policy | Treated as evidence, not a verdict; cross-checked against other signals | S1, S4, S6 |
| False-positive sources | Privacy tools, travel, corporate networks, unusual devices | S1, S4, S6 |
| Overall detection accuracy | 99% via AI prediction weighing complete pattern | S1, S4, S6 |
| Total signals used | 110+ behavioral, browser, hardware, network, attribution signals | S2 |
| Client refund recovery rate | 83% of 2,500+ audited brands recover funds from Google and Meta | S2 |
| Report format | Refund-ready with click IDs, campaign details, timestamps, session recordings, signal-by-signal reasoning | S2 |
Limitations and when this advice does not apply
- Sophisticated stealth plugins — Playwright Stealth and similar projects actively patch the exact inconsistencies described here. They reduce but rarely eliminate all cross-context mismatches.
- Legitimate edge cases — Antivirus browsers, accessibility tools, and enterprise security products can modify APIs in ways that mimic automation. Always corroborate.
- Client-side only — These checks run in the browser. Server-side logs (IP, headers) provide complementary evidence but cannot see canvas or iframe mismatches.
- Maintenance burden — Browser updates change API surfaces. Detection rules need continuous testing against new browser versions and automation framework releases.
FAQ
Can I detect Playwright with just navigator.webdriver?
No. Modern Playwright configurations hide or remove that property. It catches only naive scripts. Use it as one signal among many.
How often do privacy extensions trigger false positives?
Common extensions (ad blockers, privacy tools) alter permissions and canvas output. That's why BotRefund treats any single anomaly as evidence, not a verdict, and cross-checks against network, device, and behavioral signals.
What is a clean-context iframe and why does it help?
An iframe loaded with sandbox attributes that strip the parent's scripts exposes the browser's native APIs without automation patches. Comparing the iframe's API responses to the main frame reveals inconsistencies that automation cannot easily hide.
Do I need to build all 100+ checks myself?
You can start with the five core browser API checks above. For production scale, a managed service like BotRefund provides the full 106-check suite, continuous updates, and the correlation model that turns raw signals into platform-accepted refund evidence.
How long does it take to implement a basic detection script?
A minimal version covering navigator, permissions, canvas, and iframe probe can be written in a few hours. Tuning thresholds and adding network/behavior layers takes weeks of iteration on live traffic.
Will this detection work for other automation tools like Puppeteer or Selenium?
Yes. The same principle applies: any tool that patches browser APIs to hide automation creates cross-context inconsistencies. The specific artifacts differ, but the detection approach — probe multiple angles, correlate signals — remains valid.
What evidence do Google and Meta require for refund claims?
They expect click IDs (GCLID, FBCLID), campaign details, timestamps, session recordings, and signal-by-signal reasoning in a structured format. BotRefund formats reports exactly to that specification, which contributes to the 83% client recovery rate.
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
How BotRefund can help
BotRefund runs 106 independent browser, network, device, and behavior checks — including the Playwright Init Scripts and Clean Context Iframe probes described above — and feeds every signal into an AI prediction model that weighs the complete pattern. The result is a 99% confidence bot-or-human classification and a refund-ready report formatted for Google and Meta review teams. You can start with a free bot audit to see the evidence on your own traffic.