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 ¶
const ( CommandStartObserving = "BackgroundService.startObserving" CommandStopObserving = "BackgroundService.stopObserving" CommandSetRecording = "BackgroundService.setRecording" CommandClearEvents = "BackgroundService.clearEvents" )
Command names.
Variables ¶
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.
var ClearEvents = cdp.Command[ClearEventsParams, cdp.Empty]{Method: CommandClearEvents}
ClearEvents clears all stored data for the service.
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-clearEvents
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
var SetRecording = cdp.Command[SetRecordingParams, cdp.Empty]{Method: CommandSetRecording}
SetRecording set the recording state for the service.
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-setRecording
var StartObserving = cdp.Command[StartObservingParams, cdp.Empty]{Method: CommandStartObserving}
StartObserving enables event updates for the service.
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-startObserving
var StopObserving = cdp.Command[StopObservingParams, cdp.Empty]{Method: CommandStopObserving}
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.
type EventMetadata ¶
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.