State Checks
isConnected
Indicates that the browser is connected.Note: This is async in the remote SDK, unlike the native Playwright API.
Return value
Lifecycle
contexts
Returns an array of all open browser contexts.In a newly created browser, this will return zero browser contexts. Note: This is async in the remote SDK, unlike the native Playwright API.
Return value
newContext
Creates a new browser context. It will not share cookies/cache with other browser contexts.If directly using this method to create BrowserContexts, it is best practice to explicitly close the returned context via browserContext.close() when your code is done with the BrowserContext, and before calling browser.close().
Return value
newPage
Creates a new page in a new browser context. Closing this page will close the context as well.This is a convenience API that should only be used for single-page scenarios and short snippets. Production code and testing frameworks should explicitly create browser.newContext() followed by browserContext.newPage() to control their exact life times.
Return value
close
Closes the browser and all of its pages (if any were opened).The Browser object itself is considered to be disposed and cannot be used anymore. This is similar to force-quitting the browser.
Other
browserType
Get the browser type name (chromium, firefox, or webkit) that was used to launch this browser.Note: Returns the name string. This is async in the remote SDK, unlike the native Playwright API.
Return value
version
Returns the browser version.Note: This is async in the remote SDK, unlike the native Playwright API.
Return value
newBrowserCDPSession
Returns the newly created browser session.CDP Sessions are only supported on Chromium-based browsers.
Return value
startTracing
Starts Chromium Tracing.This is a Chromium-only API. Only one trace can be active at a time per browser.
Optional page to capture screenshots from.
Tracing options.
stopTracing
Stops Chromium Tracing and returns the trace data.This is a Chromium-only API. Returns the trace data as a Buffer.
Return value

