Skip to main content
Version: 3.1

PlaywrightPlugin

The BrowserPlugin serves two purposes. First, it is the base class that specialized controllers like PuppeteerPlugin or PlaywrightPlugin extend. Second, it allows the user to configure the automation libraries and feed them to BrowserPool for use.

Hierarchy

  • BrowserPlugin<BrowserType, Parameters<BrowserType[launch]>[0], PlaywrightBrowser>
    • PlaywrightPlugin

Index

Constructors

constructor

Properties

optional_containerProxyServer

_containerProxyServer?: { ipToProxy: Map<string, string>; port: number; close: any }

Type declaration

  • ipToProxy: Map<string, string>
  • port: number
  • close: function
    • close(closeConnections: boolean): Promise<void>

    • Parameters

      • closeConnections: boolean

      Returns Promise<void>

experimentalContainers

experimentalContainers: boolean

launchOptions

launchOptions: undefined | LaunchOptions

library

library: BrowserType<{}>

name

name: string = ...

optionalproxyUrl

proxyUrl?: string

useIncognitoPages

useIncognitoPages: boolean

optionaluserDataDir

userDataDir?: string

Methods

createController

  • createController(): BrowserController<BrowserType<{}>, undefined | LaunchOptions, Browser, undefined | { acceptDownloads?: boolean; baseURL?: string; bypassCSP?: boolean; colorScheme?: light | dark | no-preference; deviceScaleFactor?: number; extraHTTPHeaders?: {}; forcedColors?: none | active; geolocation?: { accuracy?: number; latitude: number; longitude: number }; hasTouch?: boolean; httpCredentials?: { password: string; username: string }; ignoreHTTPSErrors?: boolean; isMobile?: boolean; javaScriptEnabled?: boolean; locale?: string; logger?: Logger; offline?: boolean; permissions?: string[]; proxy?: { bypass?: string; password?: string; server: string; username?: string }; recordHar?: { content?: embed | omit | attach; mode?: full | minimal; omitContent?: boolean; path: string; urlFilter?: string | RegExp }; recordVideo?: { dir: string; size?: { height: number; width: number } }; reducedMotion?: reduce | no-preference; screen?: { height: number; width: number }; serviceWorkers?: block | allow; storageState?: string | { cookies: { domain: string; expires: number; httpOnly: boolean; name: string; path: string; sameSite: Strict | Lax | None; secure: boolean; value: string }[]; origins: { localStorage: { name: string; value: string }[]; origin: string }[] }; strictSelectors?: boolean; timezoneId?: string; userAgent?: string; videoSize?: { height: number; width: number }; videosPath?: string; viewport?: null | { height: number; width: number } }, Page>
  • Returns BrowserController<BrowserType<{}>, undefined | LaunchOptions, Browser, undefined | { acceptDownloads?: boolean; baseURL?: string; bypassCSP?: boolean; colorScheme?: light | dark | no-preference; deviceScaleFactor?: number; extraHTTPHeaders?: {}; forcedColors?: none | active; geolocation?: { accuracy?: number; latitude: number; longitude: number }; hasTouch?: boolean; httpCredentials?: { password: string; username: string }; ignoreHTTPSErrors?: boolean; isMobile?: boolean; javaScriptEnabled?: boolean; locale?: string; logger?: Logger; offline?: boolean; permissions?: string[]; proxy?: { bypass?: string; password?: string; server: string; username?: string }; recordHar?: { content?: embed | omit | attach; mode?: full | minimal; omitContent?: boolean; path: string; urlFilter?: string | RegExp }; recordVideo?: { dir: string; size?: { height: number; width: number } }; reducedMotion?: reduce | no-preference; screen?: { height: number; width: number }; serviceWorkers?: block | allow; storageState?: string | { cookies: { domain: string; expires: number; httpOnly: boolean; name: string; path: string; sameSite: Strict | Lax | None; secure: boolean; value: string }[]; origins: { localStorage: { name: string; value: string }[]; origin: string }[] }; strictSelectors?: boolean; timezoneId?: string; userAgent?: string; videoSize?: { height: number; width: number }; videosPath?: string; viewport?: null | { height: number; width: number } }, Page>

createLaunchContext

  • createLaunchContext(options?: CreateLaunchContextOptions<BrowserType<{}>, undefined | LaunchOptions, Browser, undefined | { acceptDownloads?: boolean; baseURL?: string; bypassCSP?: boolean; colorScheme?: light | dark | no-preference; deviceScaleFactor?: number; extraHTTPHeaders?: {}; forcedColors?: none | active; geolocation?: { accuracy?: number; latitude: number; longitude: number }; hasTouch?: boolean; httpCredentials?: { password: string; username: string }; ignoreHTTPSErrors?: boolean; isMobile?: boolean; javaScriptEnabled?: boolean; locale?: string; logger?: Logger; offline?: boolean; permissions?: string[]; proxy?: { bypass?: string; password?: string; server: string; username?: string }; recordHar?: { content?: embed | omit | attach; mode?: full | minimal; omitContent?: boolean; path: string; urlFilter?: string | RegExp }; recordVideo?: { dir: string; size?: { height: number; width: number } }; reducedMotion?: reduce | no-preference; screen?: { height: number; width: number }; serviceWorkers?: block | allow; storageState?: string | { cookies: { domain: string; expires: number; httpOnly: boolean; name: string; path: string; sameSite: Strict | Lax | None; secure: boolean; value: string }[]; origins: { localStorage: { name: string; value: string }[]; origin: string }[] }; strictSelectors?: boolean; timezoneId?: string; userAgent?: string; videoSize?: { height: number; width: number }; videosPath?: string; viewport?: null | { height: number; width: number } }, Page>): LaunchContext<BrowserType<{}>, undefined | LaunchOptions, Browser, undefined | { acceptDownloads?: boolean; baseURL?: string; bypassCSP?: boolean; colorScheme?: light | dark | no-preference; deviceScaleFactor?: number; extraHTTPHeaders?: {}; forcedColors?: none | active; geolocation?: { accuracy?: number; latitude: number; longitude: number }; hasTouch?: boolean; httpCredentials?: { password: string; username: string }; ignoreHTTPSErrors?: boolean; isMobile?: boolean; javaScriptEnabled?: boolean; locale?: string; logger?: Logger; offline?: boolean; permissions?: string[]; proxy?: { bypass?: string; password?: string; server: string; username?: string }; recordHar?: { content?: embed | omit | attach; mode?: full | minimal; omitContent?: boolean; path: string; urlFilter?: string | RegExp }; recordVideo?: { dir: string; size?: { height: number; width: number } }; reducedMotion?: reduce | no-preference; screen?: { height: number; width: number }; serviceWorkers?: block | allow; storageState?: string | { cookies: { domain: string; expires: number; httpOnly: boolean; name: string; path: string; sameSite: Strict | Lax | None; secure: boolean; value: string }[]; origins: { localStorage: { name: string; value: string }[]; origin: string }[] }; strictSelectors?: boolean; timezoneId?: string; userAgent?: string; videoSize?: { height: number; width: number }; videosPath?: string; viewport?: null | { height: number; width: number } }, Page>
  • Creates a LaunchContext with all the information needed to launch a browser. Aside from library specific launch options, it also includes internal properties used by BrowserPool for management of the pool and extra features.


    Parameters

    • options: CreateLaunchContextOptions<BrowserType<{}>, undefined | LaunchOptions, Browser, undefined | { acceptDownloads?: boolean; baseURL?: string; bypassCSP?: boolean; colorScheme?: light | dark | no-preference; deviceScaleFactor?: number; extraHTTPHeaders?: {}; forcedColors?: none | active; geolocation?: { accuracy?: number; latitude: number; longitude: number }; hasTouch?: boolean; httpCredentials?: { password: string; username: string }; ignoreHTTPSErrors?: boolean; isMobile?: boolean; javaScriptEnabled?: boolean; locale?: string; logger?: Logger; offline?: boolean; permissions?: string[]; proxy?: { bypass?: string; password?: string; server: string; username?: string }; recordHar?: { content?: embed | omit | attach; mode?: full | minimal; omitContent?: boolean; path: string; urlFilter?: string | RegExp }; recordVideo?: { dir: string; size?: { height: number; width: number } }; reducedMotion?: reduce | no-preference; screen?: { height: number; width: number }; serviceWorkers?: block | allow; storageState?: string | { cookies: { domain: string; expires: number; httpOnly: boolean; name: string; path: string; sameSite: Strict | Lax | None; secure: boolean; value: string }[]; origins: { localStorage: { name: string; value: string }[]; origin: string }[] }; strictSelectors?: boolean; timezoneId?: string; userAgent?: string; videoSize?: { height: number; width: number }; videosPath?: string; viewport?: null | { height: number; width: number } }, Page> = {}

    Returns LaunchContext<BrowserType<{}>, undefined | LaunchOptions, Browser, undefined | { acceptDownloads?: boolean; baseURL?: string; bypassCSP?: boolean; colorScheme?: light | dark | no-preference; deviceScaleFactor?: number; extraHTTPHeaders?: {}; forcedColors?: none | active; geolocation?: { accuracy?: number; latitude: number; longitude: number }; hasTouch?: boolean; httpCredentials?: { password: string; username: string }; ignoreHTTPSErrors?: boolean; isMobile?: boolean; javaScriptEnabled?: boolean; locale?: string; logger?: Logger; offline?: boolean; permissions?: string[]; proxy?: { bypass?: string; password?: string; server: string; username?: string }; recordHar?: { content?: embed | omit | attach; mode?: full | minimal; omitContent?: boolean; path: string; urlFilter?: string | RegExp }; recordVideo?: { dir: string; size?: { height: number; width: number } }; reducedMotion?: reduce | no-preference; screen?: { height: number; width: number }; serviceWorkers?: block | allow; storageState?: string | { cookies: { domain: string; expires: number; httpOnly: boolean; name: string; path: string; sameSite: Strict | Lax | None; secure: boolean; value: string }[]; origins: { localStorage: { name: string; value: string }[]; origin: string }[] }; strictSelectors?: boolean; timezoneId?: string; userAgent?: string; videoSize?: { height: number; width: number }; videosPath?: string; viewport?: null | { height: number; width: number } }, Page>

launch

  • launch(launchContext?: LaunchContext<BrowserType<{}>, undefined | LaunchOptions, Browser, undefined | { acceptDownloads?: boolean; baseURL?: string; bypassCSP?: boolean; colorScheme?: light | dark | no-preference; deviceScaleFactor?: number; extraHTTPHeaders?: {}; forcedColors?: none | active; geolocation?: { accuracy?: number; latitude: number; longitude: number }; hasTouch?: boolean; httpCredentials?: { password: string; username: string }; ignoreHTTPSErrors?: boolean; isMobile?: boolean; javaScriptEnabled?: boolean; locale?: string; logger?: Logger; offline?: boolean; permissions?: string[]; proxy?: { bypass?: string; password?: string; server: string; username?: string }; recordHar?: { content?: embed | omit | attach; mode?: full | minimal; omitContent?: boolean; path: string; urlFilter?: string | RegExp }; recordVideo?: { dir: string; size?: { height: number; width: number } }; reducedMotion?: reduce | no-preference; screen?: { height: number; width: number }; serviceWorkers?: block | allow; storageState?: string | { cookies: { domain: string; expires: number; httpOnly: boolean; name: string; path: string; sameSite: Strict | Lax | None; secure: boolean; value: string }[]; origins: { localStorage: { name: string; value: string }[]; origin: string }[] }; strictSelectors?: boolean; timezoneId?: string; userAgent?: string; videoSize?: { height: number; width: number }; videosPath?: string; viewport?: null | { height: number; width: number } }, Page>): Promise<Browser>
  • Launches the browser using provided launch context.


    Parameters

    • launchContext: LaunchContext<BrowserType<{}>, undefined | LaunchOptions, Browser, undefined | { acceptDownloads?: boolean; baseURL?: string; bypassCSP?: boolean; colorScheme?: light | dark | no-preference; deviceScaleFactor?: number; extraHTTPHeaders?: {}; forcedColors?: none | active; geolocation?: { accuracy?: number; latitude: number; longitude: number }; hasTouch?: boolean; httpCredentials?: { password: string; username: string }; ignoreHTTPSErrors?: boolean; isMobile?: boolean; javaScriptEnabled?: boolean; locale?: string; logger?: Logger; offline?: boolean; permissions?: string[]; proxy?: { bypass?: string; password?: string; server: string; username?: string }; recordHar?: { content?: embed | omit | attach; mode?: full | minimal; omitContent?: boolean; path: string; urlFilter?: string | RegExp }; recordVideo?: { dir: string; size?: { height: number; width: number } }; reducedMotion?: reduce | no-preference; screen?: { height: number; width: number }; serviceWorkers?: block | allow; storageState?: string | { cookies: { domain: string; expires: number; httpOnly: boolean; name: string; path: string; sameSite: Strict | Lax | None; secure: boolean; value: string }[]; origins: { localStorage: { name: string; value: string }[]; origin: string }[] }; strictSelectors?: boolean; timezoneId?: string; userAgent?: string; videoSize?: { height: number; width: number }; videosPath?: string; viewport?: null | { height: number; width: number } }, Page> = ...

    Returns Promise<Browser>