package js.html
extends WorkerGlobalScope › EventTarget
Available on jsThe
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:
read only clients:Clients
Contains the Clients
object associated with the service worker.
onactivate:Function
An event handler fired whenever an activate
event occurs — when a ServiceWorkerRegistration
acquires a new ServiceWorkerRegistration.active
worker.
onfetch:Function
An event handler fired whenever a fetch
event occurs — when a GlobalFetch.fetch
is called.
oninstall:Function
An event handler fired whenever an install
event occurs — when a ServiceWorkerRegistration
acquires a new ServiceWorkerRegistration.installing
worker.
onmessage:Function
An 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:Function
An event handler fired whenever a notificationclick
event occurs — when a user clicks on a displayed notification.
onpush:Function
An event handler fired whenever a push
event occurs — when a server push notification is received.
onpushsubscriptionchange:Function
An 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 only registration:ServiceWorkerRegistration
Contains the ServiceWorkerRegistration
object that represents the service worker's registration.
skipWaiting ():Promise<Void>
Throws:
null |
DOMError |
---|
© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/ServiceWorkerGlobalScope.html