Methods

Chrome DevTools

BackgroundService.clearEvents #

Clears all stored data for the service.

Parameters

service

Chrome DevTools

BackgroundService.setRecording #

Set the recording state for the service.

Parameters

shouldRecord
boolean
service

Chrome DevTools

BackgroundService.startObserving #

Enables event updates for the service.

Parameters

service

Chrome DevTools

BackgroundService.stopObserving #

Disables event updates for the service.

Parameters

service

Events

Chrome DevTools

BackgroundService.backgroundServiceEventReceived #

Called with all existing backgroundServiceEvents when enabled, and all new events afterwards if enabled and recording.

Parameters

backgroundServiceEvent

Chrome DevTools

BackgroundService.recordingStateChanged #

Called when the recording state for the service has been updated.

Parameters

isRecording
boolean
service

Types

Chrome DevTools

BackgroundService.BackgroundServiceEvent #

Type: object

Properties

timestamp
Network.TimeSinceEpoch

Timestamp of the event (in seconds).

origin
string

The origin this event belongs to.

serviceWorkerRegistrationId
ServiceWorker.RegistrationID

The Service Worker ID that initiated the event.

service
ServiceName

The Background Service this event belongs to.

eventName
string

A description of the event.

instanceId
string

An identifier that groups related events together.

eventMetadata
array[ EventMetadata ]

A list of event-specific information.

storageKey
string

Storage key this event belongs to.


Chrome DevTools

BackgroundService.EventMetadata #

A key-value pair for additional event information to pass along.

Type: object

Properties

key
string
value
string

Chrome DevTools

BackgroundService.ServiceName #

The Background Service that will be associated with the commands/events. Every Background Service operates independently, but they share the same API.

Type: string

Allowed values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync