Seatext library / BotRefund evidence

How to Distinguish Playwright Bots from Human Users: A Practical Detection Process

Playwright bots drive real browser engines, so they look human at the network level. You distinguish them by collecting browser-level signals — Playwright Init Scripts mismatches, scrollbar width leaks, clean-context iframe anomalies — and...

Built for advertisers who need clear, refund-ready traffic evidence.

Playwright bots are harder to catch than old-school scrapers because they run actual Chromium, Firefox, or WebKit instances. They render JavaScript, execute cookies, and pass basic fingerprint checks. The difference shows up in the details: automation frameworks patch browser APIs to hide themselves, and those patches leave consistent fingerprints. At the same time, scripted interactions lack the microscopic variability of human movement — no tremor, no hesitation, no natural acceleration curves. Reliable distinction comes from layering browser-consistency checks with behavioral biometrics and then cross-referencing every signal against the others.

Why Playwright Bots Are Hard to Spot

Traditional server-side filters look at IP reputation, user-agent strings, and request headers. Playwright bots rotate residential proxies, spoof user agents, and send realistic header stacks. Because they execute the full page — including your analytics and ad pixels — they inflate metrics that server logs alone cannot explain. Client-side detection is the only layer that sees the browser's internal state and the visitor's actual pointer behavior.

BotRefund's documentation notes that privacy tools, corporate networks, travel, and unusual devices can make genuine visitors look anomalous in isolation. That is why each signal is kept as evidence, not a verdict, and weighed against 100+ other independent checks before a session is scored.

Core Browser-Level Signals That Reveal Automation

Playwright Init Scripts Mismatch

Playwright injects initialization scripts to patch APIs such as navigator.webdriver, permissions, and runtime properties. Those patches sometimes break when the same API is queried from a different context — for example, inside an isolated world or a cross-origin iframe. The Init Scripts check compares the expected browser behavior with what the patched environment actually returns. A mismatch is a strong indicator of automation, but it is recorded as one independent fact among many.

Scrollbar Width Leak

Automated scripts often run in headless or controlled viewports where scrollbar metrics differ from a user's actual OS and browser settings. The Scrollbar Width Leak check measures the reported scrollbar width against the platform norm. A discrepancy suggests the rendering context is not a standard user session.

Clean Context Iframe Anomaly

Automation tools patch the main world but may miss an isolated iframe context. The Clean Context Iframe check loads a sandboxed iframe and probes browser APIs from inside it. If the iframe reveals unpatched properties — such as the original navigator.webdriver value or missing permissions — the session is flagged for automation evidence.

Additional Browser Fingerprints

  • Canvas and WebGL rendering differences caused by headless GPU configurations
  • Navigator property inconsistencies (plugins, languages, hardwareConcurrency)
  • Permission API states that differ from a normal user profile
  • Timing API precision changes introduced by automation frameworks

Behavioral Patterns That Separate Bots from Humans

Pointer Behavior: Robotic Linear Movements

Human mouse paths curve, overshoot, and correct. Playwright's default page.mouse.move() produces straight-line segments between waypoints. BotRefund's pointer behavior check flags unnaturally straight paths that rarely appear in real sessions.

Motion Behavior: Absence of Humanlike Tremor

Even a steady hand produces micro-jitter at 8–12 Hz. Scripted movement lacks this physiological tremor. The motion behavior signal measures high-frequency variance in pointer coordinates; its absence is recorded as automation evidence.

Speed Behavior: Superhuman Input Speed (<1 ms)

Clicks, keystrokes, and form submissions that complete in sub-millisecond intervals exceed human neuromuscular limits. The speed behavior check timestamps every interaction and flags sequences faster than a person can physically perform.

Path Behavior: Grid-Aligned Movement Patterns

Automation frameworks often snap to element centers or coordinate grids. Human paths drift between elements. Grid-aligned movement — where successive points fall on predictable pixel boundaries — is a repeatable bot signature.

Engagement Behavior: Absence of Clicks or Scrolling

Sessions that load a page, trigger conversion pixels, and leave without any scroll, text selection, or secondary clicks are inconsistent with human browsing. This signal captures the "ghost click" pattern where only the target action occurs.

Trap Behavior: Honeypot Interactions

Hidden or visually obscured elements (honeypots) should never receive human input. Bots that crawl the DOM and click every link or button will trigger these traps. Each interaction is logged as independent evidence.

Session Behavior: Unnatural Durations

Visit lengths that are too short (instant bounce after click), too long (idle beyond plausible reading time), or too uniform (every session within a narrow second range) indicate scripted pacing rather than human variability.

How to Build a Multi-Signal Detection Process

  1. Instrument the client side. Deploy a lightweight script that collects browser APIs, pointer coordinates, scroll events, timestamps, and iframe probe results on every session.
  2. Run the 100+ independent checks. Include Playwright Init Scripts, Scrollbar Width Leak, Clean Context Iframe, canvas/WebGL/navigator fingerprints, and the seven behavioral signals above.
  3. Treat each check as evidence, not a verdict. Store every signal with its raw value, timestamp, and context (viewport, device, network).
  4. Cross-check signals against each other. A single Init Scripts mismatch on a corporate laptop with a privacy extension is weak evidence. The same mismatch combined with linear pointer paths, sub-millisecond clicks, and a scrollbar width leak builds a consistent automation story.
  5. Feed the full pattern into a scoring model. BotRefund's prediction AI weighs the complete picture across browser, network, device, and behavior layers to reach 99% confidence in the bot/human classification.
  6. Produce session-level reports. Each flagged session should include click IDs, campaign details, timestamps, signal-by-signal reasoning, and a session recording — formatted for Google and Meta invalid-traffic claim reviews.
  7. Verify with ground truth. Periodically sample scored sessions, manually review recordings, and adjust signal weights or thresholds based on false-positive and false-negative rates.

Common Mistakes That Lead to False Positives

  • Relying on a single signal. User-agent strings, IP reputation, or any one browser check will misclassify legitimate users (privacy tools, VPNs, enterprise proxies, accessibility software).
  • Treating anomalies as proof. A scrollbar width leak on a rare Linux window manager is not automation. Cross-checking prevents this error.
  • Ignoring legitimate reasons for "bot-like" behavior. Screen readers, keyboard-only navigation, motor impairments, and automated testing by your own QA team can mimic automation signals. Maintain an allowlist for known internal traffic and accessibility patterns.
  • Blocking without evidence preservation. If you block at the edge, you lose the session recording and signal breakdown needed for ad-platform refund claims.
  • Using static thresholds. Human behavior varies by device, culture, and context. Adaptive baselines per traffic segment outperform fixed cutoffs.

Verification: How to Confirm Your Detection Works

  1. Run a controlled test: drive Playwright (with and without stealth plugins) through your instrumented pages. Confirm each of the 100+ checks fires as expected.
  2. Run a human panel: record 50+ real users on varied devices and networks. Verify false-positive rate stays below your tolerance (BotRefund targets <1%).
  3. Compare ad-platform reports: after deployment, measure the gap between platform-reported clicks and your verified human sessions. A persistent 10–20% gap suggests residual bot traffic.
  4. File a test refund claim with Google or Meta using your session-level evidence. Acceptance rate is the ultimate validation — BotRefund clients see 83% approval across 2,500+ audits.

Limitations and When This Advice Does Not Apply

  • Non-browser automation. Tools that drive HTTP directly (cURL, Python requests) never reach client-side checks. You need server-side anomaly detection for that layer.
  • Sophisticated stealth forks. Custom Playwright builds that patch the Init Scripts, scrollbar, and iframe probes simultaneously can evade individual checks. Cross-signal correlation still catches most, but the arms race continues.
  • Low-traffic sites. Statistical models need volume to build reliable baselines. Under 10k sessions/month, manual review of anomalies is more practical than automated scoring.
  • Strict privacy regulations. Some jurisdictions restrict fingerprinting and behavioral biometrics. Ensure your data collection has a lawful basis and honors consent signals.
  • First-party fraud. Real humans paid to click (click farms) pass browser and behavioral checks because they are human. Attribution and CRM outcome analysis are required for that layer.

Key Facts

MetricDetailSource
Independent browser/behavior checks106+ signals (Init Scripts, Scrollbar Width, Clean Context Iframe, pointer, motion, speed, path, engagement, trap, session)S1, S4, S6, S2
Overall detection confidence99% accuracy via AI prediction model weighing complete patternS1, S4, S6, S2
Client refund recovery rate83% of 2,500+ audited brands recover funds from Google and MetaS2
Estimated bot click wasteUp to 20% of Google and Meta ad budgetS2
Evidence formatSession-level reports with click IDs, timestamps, recordings, signal-by-signal reasoning — accepted by Google and MetaS2
Single-signal policyEvery anomaly kept as evidence, not a verdict; cross-checked against independent browser, network, device, behavior dataS1, S4, S6

FAQ

Can I detect Playwright bots with just JavaScript on my page?

Yes, but you need a suite of checks, not one script. The Init Scripts, scrollbar, and iframe probes require access to browser internals that a single inline script can collect. Behavioral signals (pointer, motion, speed) need continuous event listeners. A maintained library or service handles browser-version drift and false-positive tuning.

Does Playwright Stealth plugin bypass these checks?

Stealth plugins patch the most common fingerprints (navigator.webdriver, permissions, chrome.runtime). They do not fully eliminate Init Scripts mismatches, scrollbar width leaks, or clean-context iframe anomalies. Behavioral signals — tremor, speed, path geometry — are unaffected by API patching and remain strong evidence.

How many sessions do I need before the model is reliable?

Statistical baselines stabilize around 10,000–50,000 sessions per traffic segment (device × geo × channel). Below that, use rule-based thresholds with manual review. BotRefund's model is pre-trained on millions of labeled sessions across 2,500+ brands.

What if my legitimate users use privacy extensions that look like automation?

Privacy tools (Privacy Badger, uBlock, Brave Shields) can trigger individual browser checks. The cross-signal approach handles this: a privacy user still shows human tremor, natural speed variance, and curved pointer paths. The aggregate pattern stays human.

Can I use this detection to block bots in real time?

You can, but blocking destroys the evidence needed for ad-platform refunds. Better: score every session, log the full signal set, and route suspected bot traffic to a challenge page or honeypot while preserving the session recording for later claims.

How does this differ from Cloudflare Bot Management or DataDome?

Cloudflare and DataDome operate at the edge (WAF/CDN layer) using IP reputation, TLS fingerprinting, and challenge pages. They excel at volumetric and credential-stuffing bots. Client-side detection like BotRefund sees browser internals and micro-behavior that edge layers cannot, making it complementary — especially for refund-grade evidence.

What does implementation cost?

Open-source libraries (playwright-detector, fingerprints) are free but require engineering to maintain, tune, and format reports for Google/Meta. Managed services charge by traffic volume; BotRefund offers a free audit tier and paid plans that include claim negotiation. The 83% refund recovery rate across 2,500+ audits is the relevant ROI benchmark.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

Learn more

Visit the website for more information.

Learn more