serviceworker

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package serviceworker provides the Chrome DevTools Protocol commands, types, and events for the ServiceWorker domain.

Generated by the cdproto-gen command.

Index

Constants

View Source
const (
	CommandDeliverPushMessage        = "ServiceWorker.deliverPushMessage"
	CommandDisable                   = "ServiceWorker.disable"
	CommandDispatchSyncEvent         = "ServiceWorker.dispatchSyncEvent"
	CommandDispatchPeriodicSyncEvent = "ServiceWorker.dispatchPeriodicSyncEvent"
	CommandEnable                    = "ServiceWorker.enable"
	CommandInspectWorker             = "ServiceWorker.inspectWorker"
	CommandSetForceUpdateOnPageLoad  = "ServiceWorker.setForceUpdateOnPageLoad"
	CommandSkipWaiting               = "ServiceWorker.skipWaiting"
	CommandStartWorker               = "ServiceWorker.startWorker"
	CommandStopAllWorkers            = "ServiceWorker.stopAllWorkers"
	CommandStopWorker                = "ServiceWorker.stopWorker"
	CommandUnregister                = "ServiceWorker.unregister"
	CommandUpdateRegistration        = "ServiceWorker.updateRegistration"
)

Command names.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeliverPushMessageParams

type DeliverPushMessageParams struct {
	Origin         string         `json:"origin"`
	RegistrationID RegistrationID `json:"registrationId"`
	Data           string         `json:"data"`
}

DeliverPushMessageParams [no description].

func DeliverPushMessage

func DeliverPushMessage(origin string, registrationID RegistrationID, data string) *DeliverPushMessageParams

DeliverPushMessage [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-deliverPushMessage

parameters:

origin
registrationID
data

func (*DeliverPushMessageParams) Do

func (p *DeliverPushMessageParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.deliverPushMessage against the provided context.

type DisableParams

type DisableParams struct{}

DisableParams [no description].

func (*DisableParams) Do

func (p *DisableParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.disable against the provided context.

type DispatchPeriodicSyncEventParams

type DispatchPeriodicSyncEventParams struct {
	Origin         string         `json:"origin"`
	RegistrationID RegistrationID `json:"registrationId"`
	Tag            string         `json:"tag"`
}

DispatchPeriodicSyncEventParams [no description].

func DispatchPeriodicSyncEvent

func DispatchPeriodicSyncEvent(origin string, registrationID RegistrationID, tag string) *DispatchPeriodicSyncEventParams

DispatchPeriodicSyncEvent [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-dispatchPeriodicSyncEvent

parameters:

origin
registrationID
tag

func (*DispatchPeriodicSyncEventParams) Do

Do executes ServiceWorker.dispatchPeriodicSyncEvent against the provided context.

type DispatchSyncEventParams

type DispatchSyncEventParams struct {
	Origin         string         `json:"origin"`
	RegistrationID RegistrationID `json:"registrationId"`
	Tag            string         `json:"tag"`
	LastChance     bool           `json:"lastChance"`
}

DispatchSyncEventParams [no description].

func DispatchSyncEvent

func DispatchSyncEvent(origin string, registrationID RegistrationID, tag string, lastChance bool) *DispatchSyncEventParams

DispatchSyncEvent [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-dispatchSyncEvent

parameters:

origin
registrationID
tag
lastChance

func (*DispatchSyncEventParams) Do

func (p *DispatchSyncEventParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.dispatchSyncEvent against the provided context.

type EnableParams

type EnableParams struct{}

EnableParams [no description].

func (*EnableParams) Do

func (p *EnableParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.enable against the provided context.

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 InspectWorkerParams

type InspectWorkerParams struct {
	VersionID string `json:"versionId"`
}

InspectWorkerParams [no description].

func InspectWorker

func InspectWorker(versionID string) *InspectWorkerParams

InspectWorker [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-inspectWorker

parameters:

versionID

func (*InspectWorkerParams) Do

func (p *InspectWorkerParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.inspectWorker against the provided context.

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 SetForceUpdateOnPageLoadParams

type SetForceUpdateOnPageLoadParams struct {
	ForceUpdateOnPageLoad bool `json:"forceUpdateOnPageLoad"`
}

SetForceUpdateOnPageLoadParams [no description].

func SetForceUpdateOnPageLoad

func SetForceUpdateOnPageLoad(forceUpdateOnPageLoad bool) *SetForceUpdateOnPageLoadParams

SetForceUpdateOnPageLoad [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-setForceUpdateOnPageLoad

parameters:

forceUpdateOnPageLoad

func (*SetForceUpdateOnPageLoadParams) Do

Do executes ServiceWorker.setForceUpdateOnPageLoad against the provided context.

type SkipWaitingParams

type SkipWaitingParams struct {
	ScopeURL string `json:"scopeURL"`
}

SkipWaitingParams [no description].

func SkipWaiting

func SkipWaiting(scopeURL string) *SkipWaitingParams

SkipWaiting [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-skipWaiting

parameters:

scopeURL

func (*SkipWaitingParams) Do

func (p *SkipWaitingParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.skipWaiting against the provided context.

type StartWorkerParams

type StartWorkerParams struct {
	ScopeURL string `json:"scopeURL"`
}

StartWorkerParams [no description].

func StartWorker

func StartWorker(scopeURL string) *StartWorkerParams

StartWorker [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-startWorker

parameters:

scopeURL

func (*StartWorkerParams) Do

func (p *StartWorkerParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.startWorker against the provided context.

type StopAllWorkersParams

type StopAllWorkersParams struct{}

StopAllWorkersParams [no description].

func (*StopAllWorkersParams) Do

func (p *StopAllWorkersParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.stopAllWorkers against the provided context.

type StopWorkerParams

type StopWorkerParams struct {
	VersionID string `json:"versionId"`
}

StopWorkerParams [no description].

func StopWorker

func StopWorker(versionID string) *StopWorkerParams

StopWorker [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-stopWorker

parameters:

versionID

func (*StopWorkerParams) Do

func (p *StopWorkerParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.stopWorker against the provided context.

type UnregisterParams

type UnregisterParams struct {
	ScopeURL string `json:"scopeURL"`
}

UnregisterParams [no description].

func Unregister

func Unregister(scopeURL string) *UnregisterParams

Unregister [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-unregister

parameters:

scopeURL

func (*UnregisterParams) Do

func (p *UnregisterParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.unregister against the provided context.

type UpdateRegistrationParams

type UpdateRegistrationParams struct {
	ScopeURL string `json:"scopeURL"`
}

UpdateRegistrationParams [no description].

func UpdateRegistration

func UpdateRegistration(scopeURL string) *UpdateRegistrationParams

UpdateRegistration [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-updateRegistration

parameters:

scopeURL

func (*UpdateRegistrationParams) Do

func (p *UpdateRegistrationParams) Do(ctx context.Context) (err error)

Do executes ServiceWorker.updateRegistration against the provided context.

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"` // The Last-Modified header value of the main script.
	ScriptResponseTime float64              `json:"scriptResponseTime,omitempty"` // 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"`
	TargetID           target.ID            `json:"targetId,omitempty"`
	RouterRules        string               `json:"routerRules,omitempty"`
}

Version serviceWorker version.

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#type-ServiceWorkerVersion

type VersionRunningStatus

type VersionRunningStatus string

VersionRunningStatus [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#type-ServiceWorkerVersionRunningStatus

const (
	VersionRunningStatusStopped  VersionRunningStatus = "stopped"
	VersionRunningStatusStarting VersionRunningStatus = "starting"
	VersionRunningStatusRunning  VersionRunningStatus = "running"
	VersionRunningStatusStopping VersionRunningStatus = "stopping"
)

VersionRunningStatus values.

func (VersionRunningStatus) MarshalJSON

func (t VersionRunningStatus) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler.

func (VersionRunningStatus) String

func (t VersionRunningStatus) String() string

String returns the VersionRunningStatus as string value.

func (*VersionRunningStatus) UnmarshalJSON

func (t *VersionRunningStatus) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies json.Unmarshaler.

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) MarshalJSON

func (t VersionStatus) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler.

func (VersionStatus) String

func (t VersionStatus) String() string

String returns the VersionStatus as string value.

func (*VersionStatus) UnmarshalJSON

func (t *VersionStatus) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies json.Unmarshaler.

Jump to

Keyboard shortcuts

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