setViewportSize
Set the viewport size. Upstream docsemulateMedia
Emulate media type, color scheme, etc. Upstream docsmainFrame
Get the main frame. Upstream docsReturn value
frames
Get all frames attached to the page. Upstream docsReturn value
frame
Get a frame by name or URL. Upstream docsReturn value
route
Route requests matching the URL pattern. Upstream docsunroute
Remove a route. Upstream docsunrouteAll
Remove all routes. Upstream docssetExtraHTTPHeaders
Set extra HTTP headers for all requests. Upstream docscontext
Get the browser context that the page belongs to. Upstream docsReturn value
setDefaultTimeout
Set the default timeout for all methods. Upstream docssetDefaultNavigationTimeout
Set the default navigation timeout. Upstream docsaddInitScript
Add a script to evaluate before page scripts run. Upstream docsaddScriptTag
Add a <script> tag to the page. Upstream docsReturn value
addStyleTag
Add a <style> tag to the page. Upstream docsReturn value
exposeBinding
Expose a binding to the page (with source info). Upstream docspause
Pause script execution (for debugging). Upstream docsvideo
Get the video object if recording is enabled. Upstream docsresult
{ path: () => Promise<string | null>; saveAs: (path: string) => Promise<void>; delete: () => Promise<void> } | null
Return value
opener
Get the page that opened this page (via window.open). Upstream docsReturn value
workers
Get all web workers in the page. Upstream docsReturn value
addLocatorHandler
Registers a handler that will be called when the specified locator becomes visible on the page.Useful for handling overlays and popups that may appear during automation.
removeLocatorHandler
Removes a previously added locator handler. Upstream docsconsoleMessages
Returns all console messages captured during the page lifecycle.Note: This is a custom method that returns accumulated console messages.
Return value
pageErrors
Returns all page errors (uncaught exceptions) captured during the page lifecycle.Note: This is a custom method that returns accumulated page errors.
Return value
requestGC
Request garbage collection in the page context.Note: This method is only available in Chromium-based browsers.
requests
Returns all requests made by the page since the last navigation.Note: This is a custom method that returns accumulated requests.
Return value
routeFromHAR
Serves network requests from a HAR (HTTP Archive) file.Useful for replaying recorded network traffic during tests.
routeWebSocket
Route WebSocket connections matching the URL pattern.Allows intercepting and modifying WebSocket traffic.

