2.7.25 • Published 13 days ago

@softvisio/playwright v2.7.25

Weekly downloads
-
License
ISC
Repository
github
Last release
13 days 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 i @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.7.25

13 days ago

2.7.22

3 months ago

2.7.24

3 months ago

2.7.23

3 months ago

2.7.21

3 months ago

2.7.20

3 months ago

2.7.19

6 months ago

2.7.18

9 months ago

2.7.17

10 months ago

2.7.16

10 months ago

2.7.15

11 months ago

2.7.14

1 year ago

2.7.11

1 year ago

2.7.13

1 year ago

2.7.12

1 year ago

2.7.9

2 years ago

2.7.10

2 years ago

2.7.8

2 years ago

2.7.7

2 years ago

2.7.4

2 years ago

2.7.3

2 years ago

2.7.6

2 years ago

2.7.5

2 years ago

2.7.0

2 years ago

2.7.2

2 years ago

2.7.1

2 years ago

2.6.1

2 years ago

2.6.0

2 years ago

2.6.3

2 years ago

2.6.2

2 years ago

2.5.0

2 years ago

2.6.5

2 years ago

2.6.4

2 years ago

2.4.6

2 years ago

2.6.6

2 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

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.2

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago