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 false or 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 window properties, prototype chains, or event handler behaviors that a normal session does not create.

Step-by-step detection implementation

  1. Collect baseline browser signals — On page load, capture navigator properties, screen details, performance.timing, and the full list of navigator.permissions queries.
  2. Run a clean-context probe — Create an iframe with sandbox attributes that strip the parent's scripts. Inside that iframe, re-query the same APIs. Compare results; mismatches indicate patching.
  3. 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.
  4. Check for init-script artifacts — Enumerate window own properties, inspect Object.getOwnPropertyDescriptors for navigator, document, and screen, and look for non-standard getters/setters or frozen properties.
  5. 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).
  6. 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

MethodWhat it catchesFalse-positive riskImplementation effort
navigator.webdriver checkBasic Playwright, Puppeteer, SeleniumLow — but easily spoofedTrivial
Permissions API mismatchAutomation that forgets to patch permissionsMedium — privacy extensions alter permissionsLow
Canvas/WebGL fingerprintHeadless or patched rendering pathsMedium — driver/GPU differences affect outputMedium
Clean-context iframe probeInit-script patches that don't propagate to iframesLow — real browsers stay consistentMedium
Multi-signal correlation (browser + network + behavior)Sophisticated bots that pass single checksLow — corroboration filters outliersHigh

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

  1. Run a controlled Playwright session against your detection script. Confirm each check flags the session.
  2. Run the same script in a real browser with common privacy extensions (uBlock, Privacy Badger). Verify false-positive rate stays low.
  3. Test on corporate networks, VPNs, and mobile hotspots. Network-layer signals should not override clean browser signals.
  4. Log every signal per session. When a platform (Google, Meta) accepts a refund claim, trace which signals contributed. Refine weights accordingly.

Key facts

FactDetailSource
Independent checks per session106 browser, network, device, and behavior checksS1
Playwright Init Scripts check purposeDetects mismatches from automation patching of browser APIsS1
Single anomaly policyTreated as evidence, not a verdict; cross-checked against other signalsS1, S4, S6
False-positive sourcesPrivacy tools, travel, corporate networks, unusual devicesS1, S4, S6
Overall detection accuracy99% via AI prediction weighing complete patternS1, S4, S6
Total signals used110+ behavioral, browser, hardware, network, attribution signalsS2
Client refund recovery rate83% of 2,500+ audited brands recover funds from Google and MetaS2
Report formatRefund-ready with click IDs, campaign details, timestamps, session recordings, signal-by-signal reasoningS2

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.

Get free bot audit