backgroundservice

package
v0.158.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 2 Imported by: 3

Documentation

Overview

Package backgroundservice provides the Chrome DevTools Protocol commands, types, and events for the BackgroundService domain.

Defines events for background web platform features.

Generated by the pdlgen command.

Index

Constants

View Source
const (
	CommandStartObserving = "BackgroundService.startObserving"
	CommandStopObserving  = "BackgroundService.stopObserving"
	CommandSetRecording   = "BackgroundService.setRecording"
	CommandClearEvents    = "BackgroundService.clearEvents"
)

Command names.

Variables

View Source
var BackgroundServiceEventReceived = cdp.Event[EventBackgroundServiceEventReceived]{Method: "BackgroundService.backgroundServiceEventReceived"}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#event-backgroundServiceEventReceived

ClearEvents clears all stored data for the service.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-clearEvents

View Source
var RecordingStateChanged = cdp.Event[EventRecordingStateChanged]{Method: "BackgroundService.recordingStateChanged"}

RecordingStateChanged called when the recording state for the service has been updated.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#event-recordingStateChanged

SetRecording set the recording state for the service.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-setRecording

StartObserving enables event updates for the service.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-startObserving

StopObserving disables event updates for the service.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-stopObserving

Functions

This section is empty.

Types

type ClearEventsParams

type ClearEventsParams struct {
	Service ServiceName `json:"service"`
}

ClearEventsParams are the parameters of the command BackgroundService.clearEvents.

type Event

type Event struct {
	Timestamp                   cdp.TimeSinceEpoch           `json:"timestamp"`                   // Timestamp of the event (in seconds).
	Origin                      string                       `json:"origin"`                      // The origin this event belongs to.
	ServiceWorkerRegistrationID serviceworker.RegistrationID `json:"serviceWorkerRegistrationId"` // The Service Worker ID that initiated the event.
	Service                     ServiceName                  `json:"service"`                     // The Background Service this event belongs to.
	EventName                   string                       `json:"eventName"`                   // A description of the event.
	InstanceID                  string                       `json:"instanceId"`                  // An identifier that groups related events together.
	EventMetadata               []*EventMetadata             `json:"eventMetadata"`               // A list of event-specific information.
	StorageKey                  string                       `json:"storageKey"`                  // Storage key this event belongs to.
}

Event [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#type-BackgroundServiceEvent

type EventBackgroundServiceEventReceived

type EventBackgroundServiceEventReceived struct {
	BackgroundServiceEvent *Event `json:"backgroundServiceEvent"`
}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#event-backgroundServiceEventReceived

type EventMetadata

type EventMetadata struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#type-EventMetadata

type EventRecordingStateChanged

type EventRecordingStateChanged struct {
	IsRecording bool        `json:"isRecording"`
	Service     ServiceName `json:"service"`
}

EventRecordingStateChanged called when the recording state for the service has been updated.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#event-recordingStateChanged

type ServiceName

type ServiceName string

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

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#type-ServiceName

const (
	ServiceNameBackgroundFetch        ServiceName = "backgroundFetch"
	ServiceNameBackgroundSync         ServiceName = "backgroundSync"
	ServiceNamePushMessaging          ServiceName = "pushMessaging"
	ServiceNameNotifications          ServiceName = "notifications"
	ServiceNamePaymentHandler         ServiceName = "paymentHandler"
	ServiceNamePeriodicBackgroundSync ServiceName = "periodicBackgroundSync"
)

ServiceName values.

func (ServiceName) String

func (t ServiceName) String() string

String returns the ServiceName as string value.

type SetRecordingParams

type SetRecordingParams struct {
	ShouldRecord bool        `json:"shouldRecord"`
	Service      ServiceName `json:"service"`
}

SetRecordingParams are the parameters of the command BackgroundService.setRecording.

type StartObservingParams

type StartObservingParams struct {
	Service ServiceName `json:"service"`
}

StartObservingParams are the parameters of the command BackgroundService.startObserving.

type StopObservingParams

type StopObservingParams struct {
	Service ServiceName `json:"service"`
}

StopObservingParams are the parameters of the command BackgroundService.stopObserving.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL