Playwright Addons Save Abandoned

Add-ons for Playwright: adblocker, stealth mode

Project README

Add-ons for Playwright

All Contributors

WARNING: Please use playwright-extra instead, this repo is now obsolete.


Old info:

This package contains add-ons for the excellent Playwright browser automation framework. This package is still in development, so no releases yet.

Installation

npm i Niek/playwright-addons#master

Example usage

(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):

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.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Alexandr

? ?

SentoxAIO

?

This project follows the all-contributors specification. Contributions of any kind welcome!

Open Source Agenda is not affiliated with "Playwright Addons" Project. README Source: Niek/playwright-addons
Stars
37
Open Issues
0
Last Commit
3 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating