Web Scraping APIs

What Is XDriver?

What Is XDriver? — conceptual illustration
On this page

XDriver is a Playwright stealth patcher that replaces Playwright's driver files in place with hardened versions, activated by a single command. Running x_driver activate backs up the original driver, swaps in patched crConnection.js / crPage.js / browserContext.js / frames.js, and from then on your existing Playwright code runs with CDP leak prevention and no import changes. x_driver deactivate restores the originals. The catch: it is version-locked to a specific Playwright release.

Quick facts

TypeIn-place Playwright driver patcher (Chromium)
LanguagePython
ActivationOne command: x_driver activate / deactivate
CoversRuntime.enable removal, binding obfuscation, WebRTC, service workers
Main limitationVersion-locked to Playwright 1.52.0; single-author beta

How XDriver patches Playwright

Unlike Patchright (a separate forked package), XDriver modifies your installed Playwright in place. x_driver activate backs up driver/package to driver/package_1, copies patched files from its bundle over the originals, and edits playwright/__init__.py. Your scripts then import the normal playwright module but run on the hardened driver — zero code changes.

The patched files avoid Runtime.enable (using Page.createIsolatedWorld instead), strip Playwright markers from injected scripts and randomise them, obfuscate binding names into isolated worlds, filter WebRTC ICE candidates to prevent IP leaks, and block service-worker registration that could fingerprint automation.

Coverage and the version-lock trade-off

The project reports passing Cloudflare, Turnstile, Kasada, DataDome, PerimeterX, Imperva and Fingerprint.com, plus 100% anonymous on CreepJS and strong scores on BrowserScan, Rebrowser, and Whoer. The big caveat is maintenance risk: XDriver is locked to Playwright 1.52.0 because it patches exact file internals, it is a single-author beta (v1.0.1), Chromium-only, and a corrupted backup means manual recovery. It is invasive by design — it edits your library directory.

XDriver vs Patchright — which to pick

They achieve similar Chromium-CDP stealth differently. XDriver: in-place file replacement, no import changes, easy on/off toggling, but version-locked and single-author. Patchright: a separately maintained package that auto-tracks Playwright releases, supports Python/Node.js/.NET, and has active community support, but you import from patchright instead of playwright. Choose XDriver for quick testing on a codebase you cannot modify; choose Patchright for production and version flexibility.

Code example

python
# Terminal: pip install x_driver && pip install playwright==1.52.0
#           playwright install chromium && x_driver activate

# Then your EXISTING Playwright code runs patched — no import change:
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=False)
    page = browser.new_page()
    page.goto("https://bot.sannysoft.com")  # uses patched driver
    browser.close()
# Terminal: x_driver deactivate  # restores original Playwright

Related terms

Concept map

How XDriver connects

The terms most directly tied to this one. Hover a node to see its neighbours, click to preview, drag to rearrange.

0 terms · 0 connections
You are here · Web Scraping APIs
Building map…

Frequently asked questions

How is XDriver different from Patchright?

Both add CDP stealth to Playwright on Chromium. XDriver patches your installed Playwright files in place (no import change) but is locked to Playwright 1.52.0. Patchright is a separate package you import from, supports more languages, and auto-tracks new Playwright releases. XDriver is for quick toggling; Patchright is for production.

Why is XDriver locked to one Playwright version?

It patches the exact internals of Playwright's driver files, which change between releases. A patch built for 1.52.0 would corrupt a different version, so it is pinned. This is the main reason it is better suited to testing than long-lived production systems.

Do I need to change my code to use XDriver?

No. After x_driver activate, you import the normal playwright module and your existing scripts run on the hardened driver. That drop-in property is its main selling point for existing Playwright codebases. Run x_driver deactivate to revert.

Is XDriver production-ready?

Use caution. It is a single-author beta (v1.0.1), version-locked, and modifies your library directory in place — a corrupted backup requires manual recovery. For production, Patchright is the lower-risk choice.

Last updated: 2026-05-28