Documentation
¶
Overview ¶
Package serviceworker provides the Chrome DevTools Protocol commands, types, and events for the ServiceWorker domain.
Generated by the pdlgen command.
Index ¶
- Constants
- Variables
- type DeliverPushMessageParams
- type DispatchPeriodicSyncEventParams
- type DispatchSyncEventParams
- type ErrorMessage
- type EventWorkerErrorReported
- type EventWorkerRegistrationUpdated
- type EventWorkerVersionUpdated
- type Registration
- type RegistrationID
- type RouterCondition
- type RouterRule
- type RouterSource
- type RouterSourceDict
- type RouterSourceType
- type SetForceUpdateOnPageLoadParams
- type SkipWaitingParams
- type StartWorkerParams
- type StopWorkerParams
- type UnregisterParams
- type UpdateRegistrationParams
- type Version
- type VersionRunningStatus
- type VersionStatus
Constants ¶
const ( CommandDeliverPushMessage = "ServiceWorker.deliverPushMessage" CommandDisable = "ServiceWorker.disable" CommandDispatchSyncEvent = "ServiceWorker.dispatchSyncEvent" CommandDispatchPeriodicSyncEvent = "ServiceWorker.dispatchPeriodicSyncEvent" CommandEnable = "ServiceWorker.enable" CommandSetForceUpdateOnPageLoad = "ServiceWorker.setForceUpdateOnPageLoad" CommandSkipWaiting = "ServiceWorker.skipWaiting" CommandStartWorker = "ServiceWorker.startWorker" CommandStopAllWorkers = "ServiceWorker.stopAllWorkers" CommandStopWorker = "ServiceWorker.stopWorker" CommandUnregister = "ServiceWorker.unregister" CommandUpdateRegistration = "ServiceWorker.updateRegistration" )
Command names.
Variables ¶
var DeliverPushMessage = cdp.Command[DeliverPushMessageParams, cdp.Empty]{Method: CommandDeliverPushMessage}
DeliverPushMessage [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-deliverPushMessage
var Disable = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandDisable}
Disable [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-disable
var DispatchPeriodicSyncEvent = cdp.Command[DispatchPeriodicSyncEventParams, cdp.Empty]{Method: CommandDispatchPeriodicSyncEvent}
DispatchPeriodicSyncEvent [no description].
var DispatchSyncEvent = cdp.Command[DispatchSyncEventParams, cdp.Empty]{Method: CommandDispatchSyncEvent}
DispatchSyncEvent [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-dispatchSyncEvent
var Enable = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandEnable}
Enable [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-enable
var SetForceUpdateOnPageLoad = cdp.Command[SetForceUpdateOnPageLoadParams, cdp.Empty]{Method: CommandSetForceUpdateOnPageLoad}
SetForceUpdateOnPageLoad [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-setForceUpdateOnPageLoad
var SkipWaiting = cdp.Command[SkipWaitingParams, cdp.Empty]{Method: CommandSkipWaiting}
SkipWaiting [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-skipWaiting
var StartWorker = cdp.Command[StartWorkerParams, cdp.Empty]{Method: CommandStartWorker}
StartWorker [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-startWorker
var StopAllWorkers = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandStopAllWorkers}
StopAllWorkers [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-stopAllWorkers
var StopWorker = cdp.Command[StopWorkerParams, cdp.Empty]{Method: CommandStopWorker}
StopWorker [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-stopWorker
var Unregister = cdp.Command[UnregisterParams, cdp.Empty]{Method: CommandUnregister}
Unregister [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-unregister
var UpdateRegistration = cdp.Command[UpdateRegistrationParams, cdp.Empty]{Method: CommandUpdateRegistration}
UpdateRegistration [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-updateRegistration
var WorkerErrorReported = cdp.Event[EventWorkerErrorReported]{Method: "ServiceWorker.workerErrorReported"}
WorkerErrorReported [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#event-workerErrorReported
var WorkerRegistrationUpdated = cdp.Event[EventWorkerRegistrationUpdated]{Method: "ServiceWorker.workerRegistrationUpdated"}
WorkerRegistrationUpdated [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#event-workerRegistrationUpdated
var WorkerVersionUpdated = cdp.Event[EventWorkerVersionUpdated]{Method: "ServiceWorker.workerVersionUpdated"}
WorkerVersionUpdated [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#event-workerVersionUpdated
Functions ¶
This section is empty.
Types ¶
type DeliverPushMessageParams ¶
type DeliverPushMessageParams struct {
Origin string `json:"origin"`
RegistrationID RegistrationID `json:"registrationId"`
Data string `json:"data"`
}
DeliverPushMessageParams are the parameters of the command ServiceWorker.deliverPushMessage.
type DispatchPeriodicSyncEventParams ¶
type DispatchPeriodicSyncEventParams struct {
Origin string `json:"origin"`
RegistrationID RegistrationID `json:"registrationId"`
Tag string `json:"tag"`
}
DispatchPeriodicSyncEventParams are the parameters of the command ServiceWorker.dispatchPeriodicSyncEvent.
type DispatchSyncEventParams ¶
type DispatchSyncEventParams struct {
Origin string `json:"origin"`
RegistrationID RegistrationID `json:"registrationId"`
Tag string `json:"tag"`
LastChance bool `json:"lastChance"`
}
DispatchSyncEventParams are the parameters of the command ServiceWorker.dispatchSyncEvent.
type ErrorMessage ¶
type ErrorMessage struct {
ErrorMessage string `json:"errorMessage"`
RegistrationID RegistrationID `json:"registrationId"`
VersionID string `json:"versionId"`
SourceURL string `json:"sourceURL"`
LineNumber int64 `json:"lineNumber"`
ColumnNumber int64 `json:"columnNumber"`
}
ErrorMessage serviceWorker error message.
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#type-ServiceWorkerErrorMessage
type EventWorkerErrorReported ¶
type EventWorkerErrorReported struct {
ErrorMessage *ErrorMessage `json:"errorMessage"`
}
EventWorkerErrorReported [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#event-workerErrorReported
type EventWorkerRegistrationUpdated ¶
type EventWorkerRegistrationUpdated struct {
Registrations []*Registration `json:"registrations"`
}
EventWorkerRegistrationUpdated [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#event-workerRegistrationUpdated
type EventWorkerVersionUpdated ¶
type EventWorkerVersionUpdated struct {
Versions []*Version `json:"versions"`
}
EventWorkerVersionUpdated [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#event-workerVersionUpdated
type Registration ¶
type Registration struct {
RegistrationID RegistrationID `json:"registrationId"`
ScopeURL string `json:"scopeURL"`
IsDeleted bool `json:"isDeleted"`
}
Registration serviceWorker registration.
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#type-ServiceWorkerRegistration
type RegistrationID ¶
type RegistrationID string
RegistrationID [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#type-RegistrationID
func (RegistrationID) String ¶
func (t RegistrationID) String() string
String returns the RegistrationID as string value.
type RouterCondition ¶
type RouterCondition struct {
URLPattern string `json:"urlPattern,omitempty,omitzero"` // Plain text, or JSON serialization of URLPatternInit or URLPattern
RequestMethod string `json:"requestMethod,omitempty,omitzero"`
RequestMode string `json:"requestMode,omitempty,omitzero"`
RequestDestination string `json:"requestDestination,omitempty,omitzero"`
RunningStatus VersionRunningStatus `json:"runningStatus,omitempty,omitzero"`
Or []*RouterCondition `json:"or,omitempty,omitzero"`
Not *RouterCondition `json:"not,omitempty,omitzero"`
}
RouterCondition mostly corresponds to RouterCondition in ServiceWorker spec (https://www.w3.org/TR/service-workers/#dictdef-routercondition).
type RouterRule ¶
type RouterRule struct {
Condition *RouterCondition `json:"condition"`
Source *RouterSource `json:"source"`
ID int64 `json:"id"` // Rule ID assigned by the browser. Unique within each ServiceWorkerVersion.
}
RouterRule [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#type-ServiceWorkerRouterRule
type RouterSource ¶
type RouterSource struct {
Type RouterSourceType `json:"type"`
SourceDict *RouterSourceDict `json:"sourceDict,omitempty,omitzero"` // Non-empty iff type equals "sourceDict".
}
RouterSource corresponds to RouterSource in the spec while the representation is different as follows. (https://www.w3.org/TR/service-workers/#typedefdef-routersource) - RouterSourceEnum: type equals cache, sourceDict is null. - RouterSourceDict: type equals sourceDict, sourceDict has valid value.
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#type-ServiceWorkerRouterSource
type RouterSourceDict ¶
type RouterSourceDict struct {
CacheName string `json:"cacheName"`
}
RouterSourceDict https://www.w3.org/TR/service-workers/#dictdef-routersourcedict.
type RouterSourceType ¶
type RouterSourceType string
RouterSourceType [no description].
const ( RouterSourceTypeCache RouterSourceType = "cache" RouterSourceTypeFetchEvent RouterSourceType = "fetchEvent" RouterSourceTypeNetwork RouterSourceType = "network" RouterSourceTypeRaceNetworkAndFetchHandler RouterSourceType = "raceNetworkAndFetchHandler" RouterSourceTypeRaceNetworkAndCache RouterSourceType = "raceNetworkAndCache" RouterSourceTypeSourceDict RouterSourceType = "sourceDict" )
RouterSourceType values.
func (RouterSourceType) String ¶
func (t RouterSourceType) String() string
String returns the RouterSourceType as string value.
type SetForceUpdateOnPageLoadParams ¶
type SetForceUpdateOnPageLoadParams struct {
ForceUpdateOnPageLoad bool `json:"forceUpdateOnPageLoad"`
}
SetForceUpdateOnPageLoadParams are the parameters of the command ServiceWorker.setForceUpdateOnPageLoad.
type SkipWaitingParams ¶
type SkipWaitingParams struct {
ScopeURL string `json:"scopeURL"`
}
SkipWaitingParams are the parameters of the command ServiceWorker.skipWaiting.
type StartWorkerParams ¶
type StartWorkerParams struct {
ScopeURL string `json:"scopeURL"`
}
StartWorkerParams are the parameters of the command ServiceWorker.startWorker.
type StopWorkerParams ¶
type StopWorkerParams struct {
VersionID string `json:"versionId"`
}
StopWorkerParams are the parameters of the command ServiceWorker.stopWorker.
type UnregisterParams ¶
type UnregisterParams struct {
ScopeURL string `json:"scopeURL"`
}
UnregisterParams are the parameters of the command ServiceWorker.unregister.
type UpdateRegistrationParams ¶
type UpdateRegistrationParams struct {
ScopeURL string `json:"scopeURL"`
}
UpdateRegistrationParams are the parameters of the command ServiceWorker.updateRegistration.
type Version ¶
type Version struct {
VersionID string `json:"versionId"`
RegistrationID RegistrationID `json:"registrationId"`
ScriptURL string `json:"scriptURL"`
RunningStatus VersionRunningStatus `json:"runningStatus"`
Status VersionStatus `json:"status"`
ScriptLastModified float64 `json:"scriptLastModified,omitempty,omitzero"` // The Last-Modified header value of the main script.
ScriptResponseTime float64 `json:"scriptResponseTime,omitempty,omitzero"` // The time at which the response headers of the main script were received from the server. For cached script it is the last time the cache entry was validated.
ControlledClients []target.ID `json:"controlledClients,omitempty,omitzero"`
TargetID target.ID `json:"targetId,omitempty,omitzero"`
RouterRules string `json:"routerRules,omitempty,omitzero"` // Migration to typedRouterRules is in progress. The browser sends either routerRules or typedRouterRules. TODO(crbug.com/540469610): Remove routerRules after the migration.
TypedRouterRules []*RouterRule `json:"typedRouterRules,omitempty,omitzero"`
}
Version serviceWorker version.
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#type-ServiceWorkerVersion
type VersionRunningStatus ¶
type VersionRunningStatus string
VersionRunningStatus [no description].
const ( VersionRunningStatusStopped VersionRunningStatus = "stopped" VersionRunningStatusStarting VersionRunningStatus = "starting" VersionRunningStatusRunning VersionRunningStatus = "running" VersionRunningStatusStopping VersionRunningStatus = "stopping" )
VersionRunningStatus values.
func (VersionRunningStatus) String ¶
func (t VersionRunningStatus) String() string
String returns the VersionRunningStatus as string value.
type VersionStatus ¶
type VersionStatus string
VersionStatus [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#type-ServiceWorkerVersionStatus
const ( VersionStatusNew VersionStatus = "new" VersionStatusInstalling VersionStatus = "installing" VersionStatusInstalled VersionStatus = "installed" VersionStatusActivating VersionStatus = "activating" VersionStatusActivated VersionStatus = "activated" VersionStatusRedundant VersionStatus = "redundant" )
VersionStatus values.
func (VersionStatus) String ¶
func (t VersionStatus) String() string
String returns the VersionStatus as string value.