Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Niek/playwright-addons
Add-ons for Playwright: adblocker, stealth mode
https://github.com/Niek/playwright-addons
addons browser-automation playwright puppeteer-extra
Last synced: 15 days ago
JSON representation
Add-ons for Playwright: adblocker, stealth mode
- Host: GitHub
- URL: https://github.com/Niek/playwright-addons
- Owner: Niek
- License: mit
- Archived: true
- Created: 2020-06-24T10:59:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-09T19:06:04.000Z (almost 4 years ago)
- Last Synced: 2024-08-02T15:52:02.971Z (4 months ago)
- Topics: addons, browser-automation, playwright, puppeteer-extra
- Language: JavaScript
- Homepage:
- Size: 25.4 KB
- Stars: 45
- Watchers: 10
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Add-ons for Playwright
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
## WARNING: Please use [playwright-extra](https://github.com/berstend/puppeteer-extra/pull/303#issuecomment-775277480) instead, this repo is now obsolete.
---
## Old info:
This package contains add-ons for the excellent [Playwright](https://github.com/microsoft/playwright/) browser automation framework. This package is still in development, so no releases yet.
#### Installation
```bash
npm i Niek/playwright-addons#master
```#### Example usage
```js
(async () => {
const browser = await require('playwright').chromium.launch({headless: false}); // or: firefox, webkit
const addons = await import('playwright-addons');
const page = await browser.newPage();await addons.adblocker(browser);
await page.goto('https://cnn.com/');await addons.stealth(browser);
await page.goto('https://bot.sannysoft.com/');
})();
```#### Docker
Sample usage in Docker (run the script `test.js`):
```bash
docker container run -it --rm --ipc=host --cap-add=SYS_ADMIN -u root -p 5900:5900 -v $(pwd):/src -w /src \
-e PLAYWRIGHT_BROWSERS_PATH=0 -e DEBIAN_FRONTEND=noninteractive -e X11VNC_CREATE_GEOM=1280x720x24 \
-e FD_PROG="(fluxbox &) && xterm -hold -maximized -e npx nodemon test.js" mcr.microsoft.com/playwright:bionic sh -c \
"apt-get install -qq -y x11vnc git fluxbox && su pwuser -c 'npm i nodemon Niek/playwright-addons#master && x11vnc -q -create -nopw -forever'"
```
You can then connect with a VNC client to localhost:5900. The process/browser will reload on any file changes.#### Documentation
For generated documentation, see [the API docs](/api.md).
## Contributors ✨Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!