Web Scraping APIs

What Is XDriver?

What Is XDriver? — conceptual illustration
On this page

XDriver is a browser-automation tool for Playwright (a browser-automation library): one command swaps Playwright's internal driver files for versions that reduce common automation tells. You run x_driver activate; it backs up the original driver, drops in patched copies of crConnection.js / crPage.js / browserContext.js / frames.js, and from then on your normal Playwright code runs with CDP leaks closed (CDP is the Chrome DevTools Protocol, the channel Playwright uses to control the browser — and a common automation tell). No changes to your scripts. x_driver deactivate puts the originals back. The catch: it only works with one exact Playwright version.

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

Patchright is a separate forked package you install instead of Playwright; XDriver takes a different route and edits the Playwright you already have installed. x_driver activate backs up the driver/package folder to driver/package_1, copies its patched files over the originals, and tweaks playwright/__init__.py. Your scripts keep importing the normal playwright module but now run on the hardened driver — zero code changes.

The patched files close several automation tells. They avoid Runtime.enable (a CDP command anti-bot scripts watch for) and use Page.createIsolatedWorld instead; they strip and randomise Playwright's own markers in injected scripts; they hide binding names inside isolated worlds; they filter WebRTC ICE candidates so your real IP cannot leak (WebRTC is the browser's peer-to-peer feature that can expose local network addresses); and they block service-worker registration, which can otherwise be used to 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 (these are public fingerprinting and bot-detection test sites). The trade-off is maintenance risk. Because it patches exact file internals, XDriver is locked to Playwright 1.52.0; it is a one-person beta (v1.0.1), works only with Chromium, and if the backup gets corrupted you have to restore by hand. It is invasive by design — it rewrites files inside your library folder.

XDriver vs Patchright — which to pick

Both deliver similar Chromium CDP stealth, just in different ways. XDriver: replaces files in place, needs no import changes, and toggles on and off easily — but it is pinned to one Playwright version and maintained by a single author. Patchright: a separately maintained package that keeps pace with new Playwright releases, supports Python, Node.js and .NET, and has an active community — but you import from patchright instead of playwright. Pick XDriver for quick testing on a codebase you cannot modify; pick 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, so you change nothing in your code — but it only works with Playwright 1.52.0. Patchright is a separate package you import from, supports more languages, and keeps up with new Playwright releases. Use XDriver for quick on/off testing; use Patchright for production.

Why is XDriver locked to one Playwright version?

It edits the exact internals of Playwright's driver files, and those files change from release to release. A patch built for 1.52.0 would break a different version, so it is pinned to that one. That is the main reason it suits short-term testing rather than long-lived production systems.

Do I need to change my code to use XDriver?

No. After running x_driver activate, you import the normal playwright module and your existing scripts run on the hardened driver. That drop-in behaviour is its main appeal for existing Playwright codebases. Run x_driver deactivate to undo it.

Is XDriver production-ready?

Be cautious. It is a single-author beta (v1.0.1), locked to one Playwright version, and rewrites files in your library folder — and if the backup is corrupted you must recover by hand. For production, Patchright is the safer choice.

Last updated: 2026-05-31