Skip to main content
Version: 25.19.0

WebWorkerEvent enum

Signature​

export declare enum WebWorkerEvent

Enumeration Members​

Member

Value

Description

Console

"console"

Emitted when the worker calls a console API.

Error

"error"

Emitted when the worker throws an exception.

Deprecated:

Use WebWorkerEvent.Exception instead.

Exception

"exception"

Emitted when an uncaught exception happens within the worker. Contains a RemoteException.

Remarks:

The handle of the exception is disposed right after the event has been dispatched. Call move() on it synchronously inside the listener to keep it alive.

Request

"request"

(Experimental) Emitted when the worker issues a request. Contains a HTTPRequest.

Remarks:

Only supported with CDP. With WebDriver BiDi these events are never emitted.

For service workers and shared workers, network events are only delivered once a WebWorker instance exists, i.e. after Target.worker() has been called. Requests issued before that, such as requests made while a service worker starts up, are not reported.

Listeners are bound to this worker instance: if the worker is terminated and restarted (e.g. an idle extension service worker), a new WebWorker is created and listeners must be re-attached.

Requests issued by service workers and shared workers cannot be intercepted: request.continue(), abort() and respond() throw.

RequestFailed

"requestfailed"

(Experimental) Emitted when a request issued by the worker fails. Contains a HTTPRequest.

Remarks:

The same delivery rules as for WebWorkerEvent.Request apply.

RequestFinished

"requestfinished"

(Experimental) Emitted when a request issued by the worker finishes successfully. Contains a HTTPRequest.

Remarks:

The same delivery rules as for WebWorkerEvent.Request apply.

RequestServedFromCache

"requestservedfromcache"

(Experimental) Emitted when a request issued by the worker is served from cache. Contains a HTTPRequest.

Remarks:

The same delivery rules as for WebWorkerEvent.Request apply.

Response

"response"

(Experimental) Emitted when a response is received for a request issued by the worker. Contains a HTTPResponse.

Remarks:

The same delivery rules as for WebWorkerEvent.Request apply.