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.
