Seatext library / BotRefund evidence
Why Your Playwright Script Gets Blocked by Anti-Bot Systems
Playwright scripts are often blocked because automation tools patch or hide browser APIs, creating mismatches that real browsers don't produce. Anti-bot systems like BotRefund detect these inconsistencies through checks such as Playwright Init Scripts,...
✓ Built for advertisers who need clear, refund-ready traffic evidence.
Your Playwright script gets blocked because automation tools modify browser internals in ways that real browsers don't. When Playwright patches or hides APIs to avoid detection, those changes often break when the browser is examined from a different angle — for example, inside an iframe or through a secondary JavaScript context. Anti-bot systems look for exactly this kind of mismatch.
BotRefund's Playwright Init Scripts check is one of 106 independent signals that tests whether the browser's built-in properties, permissions, and rendering contexts remain consistent. A normal browser runs standard APIs as designed. An automated browser often reveals itself when those patched APIs behave differently under cross-context verification.
How Anti-Bot Systems Detect Playwright Automation
Modern bot detection doesn't rely on a single tell. Instead, it layers hundreds of independent checks across browser fingerprint, network behavior, device attributes, and interaction patterns. The Playwright Init Scripts check specifically targets the initialization scripts that Playwright injects to control the browser. These scripts can leave traces in navigator properties, window objects, or timing behaviors that differ from a genuine user session.
When a detection system runs its checks, it compares what the browser claims to be against how it actually behaves. If Playwright has overridden navigator.webdriver or modified window.chrome, but those overrides don't hold up when the same properties are accessed from a clean iframe context, the inconsistency becomes evidence.
The Playwright Init Scripts Signal Explained
BotRefund's Playwright Init Scripts check is designed to catch a specific class of mismatch: "Automation tools often patch or hide browser APIs, but those changes can break when the browser is checked from another angle." This means the detection isn't looking for Playwright itself — it's looking for the side effects of Playwright's stealth mechanisms.
The check evaluates whether the browser's standard APIs behave consistently across different execution contexts. A real browser maintains consistency because it isn't trying to hide anything. An automated browser, even with stealth plugins, often fails this cross-context consistency test because the patches applied in the main context don't perfectly propagate to every nested context.
Common Browser Fingerprint Mismatches
- Navigator property inconsistencies:
navigator.webdriver,navigator.plugins,navigator.languagesmay report values that don't match the browser's actual engine. - Window object anomalies: Missing or altered
window.chrome,window.outerWidth/innerWidthratios that don't align with screen metrics. - Timing discrepancies: JavaScript execution timing that's too fast or too uniform compared to human-driven sessions.
- Permission API gaps: Permissions that resolve instantly or in patterns that don't match user interaction flows.
- Canvas and WebGL fingerprint drift: Rendering outputs that differ when measured from a clean context versus the main page context.
These mismatches don't automatically mean "bot." As BotRefund notes, "Privacy tools, travel, corporate networks, and unusual devices can produce unexpected behavior for genuine people." That's why each signal is kept as evidence, not a verdict.
Why Single Anomalies Aren't Verdicts
Anti-bot systems that rely on one check produce false positives. A user on a corporate VPN with a privacy extension might trigger the same navigator anomaly as a Playwright script. The difference emerges when you look at the full pattern across 110+ signals: behavioral timing, mouse movement micro-tremors, scroll patterns, network latency profiles, and hardware concurrency reports.
BotRefund's approach illustrates this: "A single anomaly is not a bot verdict... BotRefund keeps this signal as evidence — not a verdict — and cross-checks it against independent browser, network, device, and behavior data." This cross-checking is what separates a privacy-conscious human from an automation script.
How Detection Systems Cross-Check Signals
The cross-check process typically follows three stages:
- Independent evidence collection: Each check (Playwright Init Scripts, Scrollbar Width Leak, Clean Context Iframe, etc.) produces one objective fact about the visit.
- Contextual corroboration: The system tests whether other signals support the same story. If Playwright Init Scripts flags a mismatch, but mouse movement, scroll behavior, and network timing all look human, the weight of that signal drops.
- AI pattern evaluation: A prediction model weighs the complete pattern instead of trusting a raw rule. BotRefund states their model "evaluates the complete picture across browser, network, device, and behavior evidence" to reach 99% accuracy.
This layered approach means evading one check isn't enough. You'd need to perfectly simulate every layer simultaneously — a much harder problem.
Practical Steps to Reduce Blocking
If you're running legitimate automation (testing, monitoring, research), you can reduce false blocks by aligning your browser profile more closely with a real user:
- Use a real browser profile with persisted cookies, cache, and localStorage instead of a fresh incognito context each run.
- Enable realistic mouse movement with variable speed, acceleration curves, and micro-tremors rather than linear paths.
- Add human-like delays: think time before clicks, scroll pauses, form field hesitation.
- Match your viewport, screen resolution, and device pixel ratio to a common device profile.
- Avoid headless mode when possible; headless browsers have distinct fingerprint signatures even with stealth plugins.
- Rotate residential IPs that match your target geography and ISP type, not data center ranges.
These steps don't guarantee passage — they reduce the number of anomalous signals. The detection system still evaluates the whole pattern.
Limitations of Evasion Techniques
Stealth plugins and evasion tools address known checks, but they operate reactively. When a new detection signal is deployed (like Clean Context Iframe or Scrollbar Width Leak), existing stealth configurations may not cover it. Maintaining an undetectable Playwright setup requires continuous updates as anti-bot vendors add new independent checks.
Additionally, evasion techniques can introduce their own anomalies. Over-patching APIs to hide automation can create the very cross-context inconsistencies that checks like Playwright Init Scripts are designed to catch. The more you modify the browser, the more surfaces you create for mismatch detection.
For legitimate use cases, the more sustainable path is often transparency: identify your automation via user-agent, respect robots.txt, rate-limit aggressively, and contact the site owner for API access or allowlisting.
Key Facts
| Fact | Detail | Source |
|---|---|---|
| Playwright Init Scripts check purpose | Detects mismatches caused when automation tools patch or hide browser APIs that break under cross-context verification | S1 |
| Single anomaly policy | "A single anomaly is not a bot verdict" — signals are kept as evidence and cross-checked | S1 |
| Cross-check methodology | Independent evidence → contextual corroboration → AI pattern evaluation across browser, network, device, behavior | S1 |
| Signal count | 106 independent checks (Playwright Init Scripts is one); 110+ total signals including behavioral, hardware, network, attribution | S1, S2 |
| Detection accuracy claim | 99% accuracy / 99% confidence in flagged bot traffic | S1, S2 |
| Refund recovery rate | 83% of 2,500+ audited clients recover funds from Google and Meta | S2 |
| Report format | Refund-ready reports with click IDs, campaign details, timestamps, session recordings, signal-by-signal reasoning | S2 |
Terminology
- Playwright Init Scripts: Initialization code Playwright injects to control the browser; can leave detectable traces in browser APIs.
- Cross-context verification: Checking whether browser properties behave consistently when accessed from different JavaScript contexts (main page, iframe, worker).
- Browser fingerprint: The collection of browser, OS, hardware, and configuration attributes that uniquely identify a client.
- Stealth plugin: A Playwright add-on (e.g., playwright-stealth) that attempts to mask automation signatures by patching APIs.
- Signal: One independent check that produces an objective fact about a visit (e.g., Playwright Init Scripts, Scrollbar Width Leak).
- Corroboration: The process of testing whether multiple independent signals support the same conclusion.
FAQ
Does using playwright-stealth guarantee my script won't be blocked?
No. Stealth plugins address known detection vectors, but anti-bot systems continuously add new independent checks (like Clean Context Iframe and Scrollbar Width Leak). A stealth plugin that passes today's checks may fail tomorrow's. Evasion is a moving target.
Why does headless mode get blocked more often than headed mode?
Headless browsers have distinct fingerprint signatures: missing GPU rendering paths, different timing profiles, and absent UI event loops. Even with stealth patches, these structural differences create cross-context mismatches that checks like Playwright Init Scripts detect.
Can a real user trigger the Playwright Init Scripts check?
Yes. Privacy extensions, corporate security policies, unusual hardware, or browser modifications can produce similar API inconsistencies. That's why the signal is treated as evidence, not a verdict — it requires corroboration from other signals.
How many signals does a typical anti-bot system evaluate?
BotRefund uses 106 independent browser-level checks plus additional behavioral, network, hardware, and attribution signals — 110+ total. Other vendors operate at similar scale. No single check determines the outcome.
What's the difference between server-side and client-side bot detection?
Server-side detection analyzes IP reputation, request headers, and traffic patterns at the network level. Client-side detection runs JavaScript in the browser to measure fingerprint, behavior, and execution environment. Client-side catches advanced bots that use residential proxies and real browser engines.
If I'm running legitimate tests, should I contact the site owner?
Yes. The most reliable approach for legitimate automation is transparency: use a descriptive user-agent, respect rate limits, and request allowlisting or API access. This avoids the arms race entirely and builds trust with the site operator.
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
If you're an advertiser losing budget to bot clicks on Google or Meta, BotRefund audits your traffic using 110+ signals — including Playwright Init Scripts, Clean Context Iframe, and Scrollbar Width Leak — to build refund-ready reports. Their AI weighs the full pattern across browser, network, device, and behavior data, achieving 99% confidence in flagged bot traffic. Across 2,500+ audits, 83% of clients recover funds from Google and Meta. The reports include click IDs, campaign details, timestamps, session recordings, and signal-by-signal reasoning formatted for platform review teams.
Note: BotRefund is designed for advertisers seeking to detect and claim refunds for invalid traffic, not for developers trying to evade detection on their own automation scripts.