package js.html
extends WorkerGlobalScope › EventTarget
Available on js
The ServiceWorkerGlobalScope interface of the ServiceWorker API represents the global execution context of a service worker.
Documentation ServiceWorkerGlobalScope by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
read onlyclients:ClientsContains the Clients object associated with the service worker.
onactivate:FunctionAn event handler fired whenever an activate event occurs — when a ServiceWorkerRegistration acquires a new ServiceWorkerRegistration.active worker.
onfetch:FunctionAn event handler fired whenever a fetch event occurs — when a GlobalFetch.fetch is called.
oninstall:FunctionAn event handler fired whenever an install event occurs — when a ServiceWorkerRegistration acquires a new ServiceWorkerRegistration.installing worker.
onmessage:FunctionAn event handler fired whenever a message event occurs — when incoming messages are received. Controlled pages can use the MessagePort.postMessage() method to send messages to service workers. The service worker can optionally send a response back via the MessagePort exposed in event.data.port, corresponding to the controlled page.
onnotificationclick:FunctionAn event handler fired whenever a notificationclick event occurs — when a user clicks on a displayed notification.
onnotificationclose:FunctionAn event handler fired whenever a notificationclose event occurs — when a user closes a displayed notification.
onpush:FunctionAn event handler fired whenever a push event occurs — when a server push notification is received.
onpushsubscriptionchange:FunctionAn event handler fired whenever a pushsubscriptionchange event occurs — when a push subscription has been invalidated, or is about to be invalidated (e.g. when a push service sets an expiration time.)
read onlyregistration:ServiceWorkerRegistrationContains the ServiceWorkerRegistration object that represents the service worker's registration.
skipWaiting():Promise<Void>Allows the current service worker registration to progress from waiting to active state while service worker clients are using it.
Throws:
null |
DOMError |
|---|
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/ServiceWorkerGlobalScope.html