Patchright
Undetected version of the Playwright testing and automation library.
Install / Use
/learn @Kaliiiiiiiiii-Vinyzu/PatchrightREADME
Patchright is a patched and undetected version of the Playwright Testing and Automation Framework. </br> It can be used as a drop-in replacement for Playwright.
[!NOTE]
This repository serves the Patchright Driver. To use Patchright, check out the Python Package, the NodeJS Package or the community-driven .Net Package
[!IMPORTANT]
Patchright only patches CHROMIUM based browsers. Firefox and Webkit are not supported.
<details open> <summary><h3>Sponsors</h1></summary> <a href="https://www.thordata.com/?ls=github&lk=Vinyzu" target="_blank"> <img alt="Thordata Banner" src="https://github.com/user-attachments/assets/58460bff-b057-4191-88da-80e0bd29b745" width="80%" /> </a>
Thordata - Your First Plan is on Us! 💰Get 100% of your first residential proxy purchase back as wallet balance, up to $900.
⚡ Why Thordata?
🌍 190+ real residential & ISP IP locations
🔐 Fully encrypted, ultra-secure connections
🚀 Optimized for web scraping, ad verification & automation workflows
🔥Don’t wait — this is your best time to start with Thordata and experience the safest, fastest proxy network.
<img width="500" alt="proxylayer" src="https://github.com/user-attachments/assets/d1c5f849-5cb0-4aff-b48c-530bda2ee03f" />
Running Patchright? Your proxy layer can decide whether you scale — or get blocked.
ProxyEmpire delivers:
- 🌍 30M+ Residential IPs (170+ countries)
- 📱 4G/5G Mobile Proxies
- 🔄 Rotating & Sticky Sessions + Unlimited Concurrent Sessions
- 🎯 Precise geo-targeting
- HTTP, HTTPS & SOCKS5 Support
<sup>Built for scraping, automation, and high-stealth workflows.</sup>
<span style="font-size:3em;"> 🔥 Special Offer: Use code Patchright30 to get 30% recurring discount (not just first month). </span>
<sup>Upgrade your proxies. Reduce bans. Scale properly.</sup>
</details>Patches
Runtime.enable Leak
This is the biggest Patch Patchright uses. To avoid detection by this leak, patchright avoids using Runtime.enable by executing Javascript in (isolated) ExecutionContexts.
Console.enable Leak
Patchright patches this leak by disabling the Console API all together. This means, console functionality will not work in Patchright. If you really need the console, you might be better off using Javascript loggers, although they also can be easily detected.
Command Flags Leaks
Patchright tweaks the Playwright Default Args to avoid detection by Command Flag Leaks. This (most importantly) affects:
--disable-blink-features=AutomationControlled(added) to avoid navigator.webdriver detection.--enable-automation(removed) to avoid navigator.webdriver detection.--disable-popup-blocking(removed) to avoid popup crashing.--disable-component-update(removed) to avoid detection as a Stealth Driver.--disable-default-apps(removed) to enable default apps.--disable-extensions(removed) to enable extensions
General Leaks
Patchright patches some general leaks in the Playwright codebase. This mainly includes poor setups and obvious detection points.
Closed Shadow Roots
Patchright is able to interact with elements in Closed Shadow Roots. Just use normal locators and Patchright will do the rest. <br/> Patchright is now also able to use XPaths in Closed Shadow Roots.
Stealth
With the right setup, Patchright currently is considered undetectable. Patchright passes:
- Brotector ✅ (with CDP-Patches)
- Cloudflare ✅
- Kasada ✅
- Akamai ✅
- Shape/F5 ✅
- Bet365 ✅
- Datadome ✅
- Fingerprint.com ✅
- CreepJS ✅
- Sannysoft ✅
- Incolumitas ✅
- IPHey ✅
- Browserscan ✅
- Pixelscan ✅
Bugs
Even though we have spent a lot of time to make Patchright as stable as possible, bugs may still occur. If you encounter any bugs, please report them in the Issues.
Patchright is now tested against the Playwright Tests after every release. See here
[!WARNING]
Patchright passes most, but not all the Playwright tests. Some bugs are considered impossible to solve, some are just not relevant. See the list of bugs and their explanation here.
Based on the Playwright Tests, we concluded that its highly unlikely that you will be affected by these bugs in regular usecases.
<details> <summary><b>Init Script Shenanigans</b></summary>Explanation
To be able to use InitScripts without Runtime.enable, Patchright uses Playwright Routes to inject JavaScript into HTML requests.
Bugs
Playwright Routes may cause some bugs in other parts of your code. Patchright InitScripts won't cause any bugs that wouldn't be caused by normal Playwright Routes. </br> If you want any of these bugs fixed, you'll have to contact the Playwright team.
Leaks
Patchright InitScripts can be detected by Timing Attacks. However, no antibot currently checks for this kind of Timing Attack and they probably won't for a good amount of time. </br> We consider them not to be a big risk of detection.
</details>TODO
- [x] Implement Option to choose Execution Context (Main/Isolated).
- [x] Fix Fixable Bugs.
- [x] Implement .patch Updater to easily show Patchright's patches.
- [x] Setup Automated Testing on new Release.
- [x] Implement Patchright on .NET.
- [ ] Implement Patchright on Java.
Development
Deployment of new Patchright versions are automatic, but bugs due to Playwright codebase changes may occur. Fixes for these bugs might take a few days to be released.
Support our work
If you choose to support our work, please contact @vinyzu or @steve_abcdef on Discord.
Copyright and License
© Vinyzu
Patchright is licensed Apache 2.0
Some Parts of the Codebase are inspired by Driverless. Thanks to Nick Webson for the idea of .patch-File Documentation.
Disclaimer
This repository is provided for educational purposes only.
No warranties are provided regarding accuracy, completeness, or suitability for any purpose. Use at your own risk—the authors and maintainers assume no liability for
Related Skills
imsg
333.7kiMessage/SMS CLI for listing chats, history, and sending messages via Messages.app.
node-connect
333.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
333.7kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
lobster
333.7kLobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (s
