Tuesday, October 13, 2026

invisible_playwright for stealthy browser automation that survives anti-bot fingerprinting

invisible_playwright for stealthy browser automation that survives anti-bot fingerprinting

A Python library that swaps two lines of Playwright code for a C++-patched anti-detect Firefox engine, for authorized testing and scraping workflows that must look like real human traffic.

Toolfeder-cr/invisible_playwright — drop-in Playwright-compatible wrapper around an anti-detect, source-patched Firefox engine
CategoryAnti-detect browser automation / fingerprint spoofing library
Primary UseRunning existing Playwright sync and async scripts against bot defenses like DataDome, Akamai, and Turnstile during authorized security testing and scraping of systems you have permission to access
Safe UseEducational and documentary analysis for authorized professionals: use only in penetration tests, private labs, or against properties where you hold explicit permission; bypassing anti-bot controls on third-party systems typically violates law and terms of service
Telemetry NoteFrom the defender's side: fingerprint consistency checks across ~200 fields, GPU getParameter cross-verification against renderer strings, and behavioral analysis of mouse timing are exactly the signals this tool tries to normalize — deviations in seed-derived personas or network/timezone mismatches remain observable at the WAF

invisible_playwright is a Python library, MIT-licensed and sitting at roughly 2,700 stars, that answers a question every scraper and authorized tester eventually hits: Playwright drives a real browser, yet commercial anti-bot products still flag it. The project's thesis is that the flag does not come from the automation API but from two orthogonal tells — a fingerprint that identifies the engine, and interaction patterns that identify the driver. The library replaces the stock Firefox binary with one patched at the C++ source level and wraps it in an API-compatible object so existing Playwright code keeps working. The pitch is deliberately minimal: swap two import and launch lines, and everything downstream behaves the same.

Architecturally, the interesting decision is where the fingerprint lives. Most stealth tools inject JavaScript overrides into the page after load — navigator.webdriver patches, canvas shims, WebGL spoofers — which leaves a detectable seam between the override and the genuine engine state. Here the fingerprint is set inside the engine itself, covering navigator, screen, GPU/WebGL, canvas, fonts, audio, WebRTC, timezone, and network characteristics, and it produces identical values whether the browser runs headless or headed. That eliminates the classic headless-vs-headed divergence that detectors cross-check, and it means there is no injected script for a page-side probe to read.

The second pillar is humanization at the driver layer. Every click, hover, and drag is executed along a natural mouse path — the README specifically describes Bezier-curve arcs with human timing rather than teleporting cursors — and each input claims to be byte-identical to a real mouse event, with a real input source, pressure, and trusted events. The framing is that captcha vendors like reCAPTCHA, hCaptcha, and Cloudflare Turnstile score two signals: is this a real browser, and is a real person using it. The engine patch answers the first; the driver humanization answers the second. Whether that holds against a specific vendor is an empirical question, but the separation of concerns is clean and analytically honest.

Installation is straightforward and the project ships a CLI for engine management: pip install invisible-playwright followed by python -m invisible_playwright fetch, which downloads the patched engine once — roughly 240 MB on Windows, 262 MB on Linux x86_64, 253 MB on Linux arm64, about 550 MB unpacked — with sha256 verification against a seal. It requires Python 3.11 or newer and supports Windows x86_64 and Linux x86_64/arm64. The installed command is invisible-playwright with a hyphen, and python -m invisible_playwright works identically without needing anything on PATH. A version subcommand reports wrapper, core, and engine versions plus the cache location, which is the kind of operational hygiene you want in a binary-distributing library.

API compatibility is close to total. The browser object returned by the context manager is a genuine playwright.sync_api.Browser or playwright.async_api.Browser, so every method works as-is, in both sync and async flavors. The maintainers are also explicit about the gaps: tracing, HAR capture, CDP, and the API request context are out of scope, and each refuses with a sentence explaining why instead of failing quietly. That last detail matters more than it sounds — silent behavioral divergence in a stealth context is exactly how runs get burned, and an explicit refusal is a defensible engineering choice. Proxy support covers socks5, socks4, http, and https, with DNS routed through the proxy by default to avoid a local resolution leak.

The fingerprint model is seed-based, which is the most technically interesting part of the design. Each session derives a distinct persona — GPU, audio, fonts, screen, and roughly 200 fields total — from a seed, and logging sf.seed lets you replay a run later; InvisiblePlaywright(seed=42) reproduces the same canvas hash and audio context every time. For targeted control, a pin dict overrides individual fields while the rest stay seed-derived, but the library refuses free-form GPU strings: a GPU pin must select one of the validated personas, because the roughly 81 getParameter values and the extension list travel with the renderer name and detectors cross-check them. This is a sophisticated point — inconsistent WebGL internals are a classic fingerprinting catch, and the library enforces consistency at the API boundary rather than trusting the user.

Timezone handling shows the same defensive thinking. By default the browser timezone is auto-derived from the egress IP — the proxy egress if a proxy is configured, otherwise the host's public IP — which closes the classic mismatch where a US proxy serves a UTC clock. An explicit IANA zone via timezone= always wins and is the only way to force a specific zone. Anyone who has watched a detector flag a session purely on timezone-versus-geolocation inconsistency will recognize this as the correct default. The README also documents a Bayesian sampler interacting with the pinning system, with the full details in docs/pinning.md.

The documentation set is unusually deep for this category. Beyond install and usage, the wiki's guides section breaks detection into seven groups — browser identity, canvas/WebGL/fonts/audio, network and WebRTC, the automation layer, AI agents, detector internals read from source, and testing methodology. The detectors section names the commercial products explicitly: Cloudflare Bot Management, Turnstile, DataDome, Kasada, Akamai Bot Manager, PerimeterX, Imperva/Incapsula, and hCaptcha, each covered in a dedicated page. There is also a troubleshooting entry for the common failure mode of one site still flagging the browser, and an essay on why navigator.webdriver alone is not the tell most people assume — useful reading even if you never run the tool.

The project sits in the middle of a three-piece ecosystem. invisible_core is the engine underneath — seed to fingerprint to preferences, plus proxy and geolocation — and this package pins it. Above it, AIHawk exposes the same engine as an MCP server (uvx aihawk, usable from clients like Claude Code or Cursor) and as a standalone UI driven by an OpenRouter key. The README is candid about the neighboring open-source projects and where each fits: Camoufox also patches C++ but ships a fingerprint database rather than deriving personas from a seed; Patchright puts its work in the Playwright driver rather than the binary; nodriver continues the undetected-chromedriver lineage over CDP; rebrowser-patches addresses the Runtime.enable CDP leak; and playwright-stealth and puppeteer-extra-plugin-stealth represent the older init-script approach, with the latter unmaintained since mid-2024. Per-tool comparison docs exist for each.

From a defensive perspective, this tool is worth studying even if you never automate anything. The README is effectively a curriculum in how server-side bot detection reasons: fingerprint coherence across hundreds of correlated fields, cross-validation of GPU strings against getParameter output, headless/headed equivalence, input-event provenance, and timezone-to-egress-IP consistency. Defenders building or tuning WAF rules can use the documented detector mechanisms — and the tool's countermeasures — as a checklist for what a sophisticated actor normalizes, and where residual signals still live: seed-derived personas are still synthetic distributions, and behavioral analysis of aggregate session timing remains outside what any single-page fingerprint can fully fake.

The policy line here is unambiguous. This is an educational, documentary analysis of a publicly documented tool for authorized professionals — penetration testers validating bot-mitigation deployments they are contracted to assess, researchers studying fingerprinting techniques, and engineers doing permissioned data collection. Pointing an anti-detect engine at systems you do not own or lack written authorization to test crosses into unauthorized access and terms-of-service violations in most jurisdictions, and nothing in this writeup should be read as encouraging that. Within a lab or an authorized engagement, invisible_playwright is one of the more thoughtfully engineered entries in the anti-detect space, and its refusal to overpromise — explicit scope limits, validated GPU personas, honest competitor comparisons — is a good sign the engineering matches the marketing.

Official project repository for feder-cr/invisible_playwright.
Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.

Share articleFacebookXLinkedIn

Continue exploring

Browse all articles →

0 comentários:

Post a Comment

Note: Only a member of this blog may post a comment.