Home

Awesome

<h1 align="center"> 🎭 Patchright </h1> <p align="center"> <a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright/blob/main/LICENSE"> <img src="https://img.shields.io/badge/License-Apache%202.0-green"> </a> <a> <img src="https://img.shields.io/badge/Based%20on-Playwright-goldenrod"> </a> <a> <img src="https://img.shields.io/badge/Driver-Patched-blue"> </a> <a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright/releases/latest"> <img alt="Patchright Version" src="https://img.shields.io/github/v/release/microsoft/playwright?display_name=release&label=Version"> </a> <a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python"> <img src="https://img.shields.io/badge/Package-Python-seagreen"> </a> <a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python/releases"> <img alt="GitHub Downloads (all assets, all releases)" src="https://img.shields.io/pepy/dt/patchright?color=red&label=Python%20Downloads"> </a> <a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-nodejs"> <img src="https://img.shields.io/badge/Package-NodeJS-seagreen"> </a> <a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-nodejs/releases"> <img alt="GitHub Downloads (all assets, all releases)" src="https://img.shields.io/npm/d18m/patchright?color=red&label=NodeJS%20Downloads"> </a> </p>

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 or the NodeJS Package.

[!WARNING]
Patchright only patches CHROMIUM based browsers. Firefox and Webkit are not supported.


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:

General Leaks

Patchright patches some general leaks in the Playwright codebase. This mainly includes poor setups and obvious detection points.


Stealth

With the right setup, Patchright currently is considered undetectable. Patchright passes:


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.

[!WARNING]
Currently, Patchright may experience some unintended behavior when evaluating JavaScript in the browser. This will be fixed when the Option to choose Execution Context (Main/Isolated) is implemented. See the TODO for more information.

[!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


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.


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 any damages, legal issues, or warranty breaches resulting from use, modification, or distribution of this code.
Any misuse or legal violations are the sole responsibility of the user.


Authors

Active Maintainer: Vinyzu </br> Co-Maintainer: Kaliiiiiiiiii