https://github.com/softvisio-node/playwright
Playwright wrapper
https://github.com/softvisio-node/playwright
Last synced: over 1 year ago
JSON representation
Playwright wrapper
- Host: GitHub
- URL: https://github.com/softvisio-node/playwright
- Owner: softvisio-node
- Created: 2021-06-03T05:02:47.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-26T01:48:24.000Z (over 1 year ago)
- Last Synced: 2025-03-26T01:51:05.804Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://softvisio-node.github.io/playwright/
- Size: 304 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
> :information_source: Please, see the full project documentation here:
# Introduction
Provides set of patches and extensions for `playwright`.
You can find original playwright API documentation [here](https://playwright.dev/docs/api/class-playwright/).
## Install
```sh
npm install @softvisio/playwright
```
It doesn't installs any browsers by default, so if you need `chromiun` you need to install it manually:
```sh
npx playwright install chromium
```
## Usage
```javascript
import playwright from "@softvisio/playwright";
```
## Class: BrowserType
Patch for the original BrowserType class. Adds following changes:
- `headless` By default under `windows` headless is set to the `false` for other platforms to the `true`.
- `executablePath` By default for `linux` platform is set to the `"/usr/bin/google-chrome-stable"`.
- `proxy` By default adds proxy server loopback that bypass all requests. It can be overridden in the browser contexts.
## Class: Browser
### browser.isHeadless
- Returns: {boolean} `true` if browser started in the `headless` mode.
### browser.newContext( options )
- `options` {Object} New context options. Below are enumerated only the changes for the original API method:
- `stealth` {boolean} Enables various stealth mode extensions, which helps to hide `headless` mode. **Default:** `true`.
- `proxy` {string|ProxyClient|Object} Added support for {ProxyClient}. If {string} is provided it will be passed to the {ProxyClient} constructor as URL.
## Class: Page
### page.imagesIsDisabled
- Returns: {boolean} `true` if images is currently disabled.
### page.disableImages()
Sets `route` filter, which filters out images requests.
## Resources