PlaywrightController
Hierarchy
- BrowserController<BrowserType, Parameters<BrowserType[launch]>[0], Browser>
- PlaywrightController
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
browserPlugin: BrowserPlugin<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 PlaywrightController
Properties
activePages
browser
Browser representation of the underlying automation library.
browserPlugin
The BrowserPlugin
instance used to launch the browser.
id
isActive
lastPageOpenedAt
launchContext
The configuration the browser was launched with.
totalPages
staticexternaldefaultMaxListeners
Methods
externaladdListener
Type parameters
- U: BROWSER_CLOSED
Parameters
externalevent: U
externallistener: BrowserControllerEvents<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>[U]
Returns PlaywrightController
close
Gracefully closes the browser and makes sure there will be no lingering browser processes.
Emits 'browserClosed' event.
Returns Promise<void>
externalemit
Type parameters
- U: BROWSER_CLOSED
Parameters
externalevent: U
externalrest...args: Parameters<BrowserControllerEvents<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>[U]>
Returns boolean
externaleventNames
Type parameters
- U: BROWSER_CLOSED
Returns U[]
getCookies
Parameters
page: Page
Returns Promise<Cookie[]>
externalgetMaxListeners
Returns number
kill
Immediately kills the browser process.
Emits 'browserClosed' event.
Returns Promise<void>
externallistenerCount
Parameters
externaltype: BROWSER_CLOSED
Returns number
externallisteners
Type parameters
- U: BROWSER_CLOSED
Parameters
externaltype: U
Returns BrowserControllerEvents<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>[U][]
normalizeProxyOptions
Parameters
proxyUrl: undefined | string
pageOptions: any
Returns Record<string, unknown>
externaloff
Type parameters
- U: BROWSER_CLOSED
Parameters
externalevent: U
externallistener: BrowserControllerEvents<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>[U]
Returns PlaywrightController
externalon
Type parameters
- U: BROWSER_CLOSED
Parameters
externalevent: U
externallistener: BrowserControllerEvents<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>[U]
Returns PlaywrightController
externalonce
Type parameters
- U: BROWSER_CLOSED
Parameters
externalevent: U
externallistener: BrowserControllerEvents<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>[U]
Returns PlaywrightController
externalprependListener
Type parameters
- U: BROWSER_CLOSED
Parameters
externalevent: U
externallistener: BrowserControllerEvents<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>[U]
Returns PlaywrightController
externalprependOnceListener
Type parameters
- U: BROWSER_CLOSED
Parameters
externalevent: U
externallistener: BrowserControllerEvents<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>[U]
Returns PlaywrightController
externalrawListeners
Type parameters
- U: BROWSER_CLOSED
Parameters
externaltype: U
Returns BrowserControllerEvents<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>[U][]
externalremoveAllListeners
Parameters
externaloptionalevent: BROWSER_CLOSED
Returns PlaywrightController
externalremoveListener
Type parameters
- U: BROWSER_CLOSED
Parameters
externalevent: U
externallistener: BrowserControllerEvents<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>[U]
Returns PlaywrightController
setCookies
Parameters
page: Page
cookies: Cookie[]
Returns Promise<void>
externalsetMaxListeners
Parameters
externaln: number
Returns PlaywrightController
The
BrowserController
serves two purposes. First, it is the base class that specialized controllers likePuppeteerController
orPlaywrightController
extend. Second, it defines the public interface of the specialized classes which provide only private methods. Therefore, we do not keep documentation for the specialized classes, because it's the same for all of them.