2.8.18 • Published 2 months ago

@softvisio/playwright v2.8.18

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

:information_source: Please, see the full project documentation here:https://softvisio-node.github.io/playwright/

Introduction

Provides set of patches and extensions for playwright.

You can find original playwright API documentation here.

Install

npm install @softvisio/playwright

It doesn't installs any browsers by default, so if you need chromiun you need to install it manually:

npx playwright install chromium

Usage

import playwright from "@softvisio/playwright";

Class: BrowserDevices

playwright.device.random();

Device profile

Device profile is a {Object} which contains varions properties, which are describes device:

  • id {string} Device ID.
  • name {string} Device name.
  • screen {Object} Screen dimensions:
    • width {integer} Screen width.
    • height {integer} Screen height.
  • viewport {Object} Viewport dimensions:
    • width {integer} Screen width.
    • height {integer} Screen height.
  • deviceScaleFactor {number} Device scale factor.
  • isMobile {boolean} true if device is a mobile device.
  • hasTouch {boolean} true if device has touch interface.
  • userAgent {string} UserAgent string.
  • userAgentPlatform {string} UserAgent platform name.
  • platform {string} Navigator platform name.
  • webglVendor {string} WebGL vendor name.
  • webglRenderer {string} WebGL renderer name.

device.random()

  • Returns: {Object} Random device profile.

device.desktop()

  • Returns: {Object} Random desktop device profile.

device.mobile()

  • Returns: {Object} Random mobile device profile.

device.windows()

  • Returns: {Object} Random windows device profile.

device.windows10()

  • Returns: {Object} Random windows10 device profile.

device.linux()

  • Returns: {Object} Random linux device profile.

device.ipad()

  • Returns: {Object} Random iPad device profile.

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:
    • device {Object} Device profile. See {BrowserDevices}.
    • 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.

2.8.18

2 months ago

2.8.17

2 months ago

2.8.16

2 months ago

2.8.15

2 months ago

2.8.12

3 months ago

2.8.11

3 months ago

2.8.14

2 months ago

2.8.13

3 months ago

2.8.1

6 months ago

2.8.0

6 months ago

2.8.3

4 months ago

2.8.2

5 months ago

2.8.5

4 months ago

2.8.4

4 months ago

2.8.7

4 months ago

2.8.6

4 months ago

2.8.9

3 months ago

2.8.8

4 months ago

2.7.27

7 months ago

2.7.26

7 months ago

2.8.10

3 months ago

2.7.25

8 months ago

2.7.22

11 months ago

2.7.24

11 months ago

2.7.23

11 months ago

2.7.21

11 months ago

2.7.20

11 months ago

2.7.19

1 year ago

2.7.18

1 year ago

2.7.17

1 year ago

2.7.16

1 year ago

2.7.15

2 years ago

2.7.14

2 years ago

2.7.11

2 years ago

2.7.13

2 years ago

2.7.12

2 years ago

2.7.9

3 years ago

2.7.10

2 years ago

2.7.8

3 years ago

2.7.7

3 years ago

2.7.4

3 years ago

2.7.3

3 years ago

2.7.6

3 years ago

2.7.5

3 years ago

2.7.0

3 years ago

2.7.2

3 years ago

2.7.1

3 years ago

2.6.1

3 years ago

2.6.0

3 years ago

2.6.3

3 years ago

2.6.2

3 years ago

2.5.0

3 years ago

2.6.5

3 years ago

2.6.4

3 years ago

2.4.6

3 years ago

2.6.6

3 years ago

2.4.5

3 years ago

2.4.4

3 years ago

2.4.1

3 years ago

2.4.3

3 years ago

2.4.2

3 years ago

2.4.0

3 years ago

2.3.23

3 years ago

2.3.22

3 years ago

2.3.21

3 years ago

2.3.20

3 years ago

2.3.19

3 years ago

2.3.18

3 years ago

2.3.17

3 years ago

2.3.16

3 years ago

2.3.13

3 years ago

2.3.15

3 years ago

2.3.14

3 years ago

2.3.12

3 years ago

2.3.9

3 years ago

2.3.11

3 years ago

2.3.10

3 years ago

2.3.8

3 years ago

2.3.7

3 years ago

2.3.6

3 years ago

2.3.5

3 years ago

2.3.4

3 years ago

2.3.3

3 years ago

2.3.2

3 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.3.0-alpha.0

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.2

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago