The browser this browser context belongs to.
Clears all permission overrides for the browser context.
Closes the browser context. All the targets that belong to the browser context will be closed.
Returns whether BrowserContext is incognito. The default browser context is the only non-incognito browser context.
Creates a new page in the browser context.
Adds the listener function to the end of the listeners array for the event named eventName
.
No checks are made to see if the listener has already been added. Multiple calls passing the same combination of
eventName
and listener will result in the listener being added, and called, multiple times.
The callback function.
Adds a one time listener function for the event named eventName
.
The next time eventName
is triggered, this listener is removed and then invoked.
The callback function.
The origin to grant permissions to, e.g. "https://example.com".
An array of permissions to grant. All permissions that are not listed here will be automatically denied.
Promise which resolves to an array of all open pages.
An array of all active targets inside the browser context.
Generated using TypeDoc
BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method
browser.newPage()
creates a page in the default browser context.