Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kaliiiiiiiiii-vinyzu/patchright-nodejs

Undetected NodeJS version of the Playwright testing and automation library.
https://github.com/kaliiiiiiiiii-vinyzu/patchright-nodejs

automation bot bots botting browser chrome chromedriver chromium cloudflare cloudflare-bypass playwright stealth undetectable undetected web-auto web-scraping webautomation webdriver webscraping

Last synced: 2 days ago
JSON representation

Undetected NodeJS version of the Playwright testing and automation library.

Awesome Lists containing this project

README

        


🎭 Patchright NodeJS












Patchright Version


GitHub Downloads (all assets, all releases)




#### Patchright is a patched and undetected version of the Playwright Testing and Automation Framework. It can be used as a drop-in replacement for Playwright.

> [!NOTE]
> This repository serves the Patchright-NodeJS Package. To use Patchright with Python, check out the [Python Package](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python).
> Also check out the main [Patchright Driver Repository](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright)

---

## Install it from NPM

```bash
# Install Patchright from NPM
npm i patchright
```

```bash
# Install Chromium-Driver for Patchright
npx patchright install chromium
```

---

## Usage
#### Just change the import and use it like playwright. Patchright is a drop-in-replacement for Playwright!

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

```js
// patchright here!
const { chromium } = require('patchright');

(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('http://example.com');
// other actions...
await browser.close();
})();
```

### Best Practices

To be completely undetected, use the following configuration:
```js
chromium.launchPersistentContext("...", {
channel: "chrome",
headless: false,
viewport: null,
});
```

---

## Patches

### [Runtime.enable](https://vanilla.aslushnikov.com/?Runtime.enable) Leak
This is the biggest Patch Patchright uses. To avoid detection by this leak, patchright avoids using [Runtime.enable](https://vanilla.aslushnikov.com/?Runtime.enable) by executing Javascript in (isolated) ExecutionContexts.

### [Console.enable](https://vanilla.aslushnikov.com/?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.

---

## Stealth

With the right setup, Patchright currently is considered undetectable.
Patchright passes:
- [Brotector](https://kaliiiiiiiiii.github.io/brotector/) βœ… (with [CDP-Patches](https://github.com/Kaliiiiiiiiii-Vinyzu/CDP-Patches/))
- [Cloudflare](https://cloudflare.com/) βœ…
- [Kasada](https://www.kasada.io/) βœ…
- [Akamai](https://www.akamai.com/products/bot-manager/) βœ…
- [Shape/F5](https://www.f5.com/) βœ…
- [Bet365](https://bet365.com/) βœ…
- [Datadome](https://datadome.co/products/bot-protection/) βœ…
- [Fingerprint.com](https://fingerprint.com/products/bot-detection/) βœ…
- [CreepJS](https://abrahamjuliot.github.io/creepjs/) βœ…
- [Sannysoft](https://bot.sannysoft.com/) βœ…
- [Incolumitas](https://bot.incolumitas.com/) βœ…
- [IPHey](https://iphey.com/) βœ…
- [Browserscan](https://browserscan.net/) βœ…
- [Pixelscan](https://pixelscan.net/) βœ…

---

## Documentation and API Reference
See the original [Playwright Documentation](https://playwright.dev/docs/intro) and [API Reference](https://playwright.dev/docs/api/class-playwright)

---

## Bugs
#### The bugs are documented in the [Patchright Driver Repository](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright#bugs).

---

### TODO
#### The TODO is documented in the [Patchright Driver Repository](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright#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](https://discord.com/users/935224495126487150) or [@steve_abcdef](https://discord.com/users/936292409426477066) on Discord.

---

## Copyright and License
Β© [Vinyzu](https://github.com/Vinyzu/)

Patchright is licensed [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)

---

## 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](https://github.com/Vinyzu/) Co-Maintainer: [Kaliiiiiiiiii](https://github.com/kaliiiiiiiiii/)