BrowserContextEvent enum
Signature
export declare const enum BrowserContextEvent
Enumeration Members
|
Member |
Value |
Description |
|---|---|---|
|
Console |
|
(Experimental) Emitted when JavaScript within any page or worker in the browser context calls one of the console API methods, e.g. Remarks: Use ConsoleMessage.page(), ConsoleMessage.frame() or ConsoleMessage.worker() to identify the originating context. Messages from workers have no page or frame: use ConsoleMessage.worker() for them. Messages logged by the browser itself (e.g. network errors or violations) can have no page, frame or worker. Events are only delivered for pages and workers that Puppeteer has attached to, e.g. via BrowserContext.pages() or Target.page(). Registering the listener before attaching guarantees that console messages replayed by the browser on attachment are not lost. With WebDriver BiDi, console messages that the browser replays while connecting are delivered once, right after Puppeteer.connect() resolves: register the listener before awaiting anything else, or they are missed. Replayed messages can be delivered after messages logged later. Service workers and shared workers are not attached automatically: their console messages are only delivered after Target.worker() has been called for their target. With WebDriver BiDi, their console messages are not reported. The arguments are shared with listeners registered on Page, WebWorker and Browser. Disposing them in one listener invalidates them for all other listeners. |
|
Request |
|
(Experimental) Emitted when any page in the browser context issues a request. Contains a HTTPRequest instance. Remarks: Use HTTPRequest.page() or HTTPRequest.frame() to identify the originating context. Requests from dedicated workers have no page or frame: use HTTPRequest.worker() for them. Dedicated worker requests and HTTPRequest.worker() are not supported with WebDriver BiDi. With CDP, events are only delivered for pages that have a Page instance, e.g. created via BrowserContext.pages() or Target.page(). Requests issued before the instance exists, such as the initial navigation of a popup, are not reported. With WebDriver BiDi, requests from all pages are reported. Requests from service workers and shared workers are not reported. These listeners only observe requests. Do not call |
|
RequestFailed |
|
(Experimental) Emitted when a request issued by any page in the browser context fails, for example by timing out. Contains a HTTPRequest instance. Remarks: HTTP error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so the request completes with BrowserContextEvent.RequestFinished and not with BrowserContextEvent.RequestFailed. The same delivery rules as for BrowserContextEvent.Request apply. |
|
RequestFinished |
|
(Experimental) Emitted when a request issued by any page in the browser context finishes successfully. Contains a HTTPRequest instance. Remarks: The same delivery rules as for BrowserContextEvent.Request apply. |
|
RequestServedFromCache |
|
(Experimental) Emitted when a request issued by any page in the browser context is served from the memory cache. Contains a HTTPRequest instance. Remarks: The same delivery rules as for BrowserContextEvent.Request apply. |
|
Response |
|
(Experimental) Emitted when a response is received for a request issued by any page in the browser context. Contains a HTTPResponse instance. Remarks: Use HTTPResponse.request() to access the originating request. The same delivery rules as for BrowserContextEvent.Request apply. |
|
TargetChanged |
|
Emitted when the url of a target inside the browser context changes. Contains a Target instance. |
|
TargetCreated |
|
Emitted when a target is created within the browser context, for example when a new page is opened by window.open or by browserContext.newPage Contains a Target instance. |
|
TargetDestroyed |
|
Emitted when a target is destroyed within the browser context, for example when a page is closed. Contains a Target instance. |