ServiceWorkerRegistration Class
A service worker registration (https://w3c.github.io/ServiceWorker/#serviceworkerregistration-interface), as seen by a window or a worker. Its ServiceWorkerRegistration.Installing, ServiceWorkerRegistration.Waiting and ServiceWorkerRegistration.Active workers are updated by tasks queued by the algorithms of the registration.
public sealed class ServiceWorkerRegistration : EventTarget- Inheritance
EventTargetServiceWorkerRegistration
Properties
| Name | Description |
|---|---|
| Active | Gets the active worker, or null. |
| Installing | Gets the installing worker, or null. |
| NavigationPreload | Gets the navigation preload manager of the registration. |
| OnUpdateFound | Gets or sets the event handler of the updatefound event. |
| Scope | Gets the serialized scope URL. |
| UpdateViaCache | Gets the update via cache mode. |
| Waiting | Gets the waiting worker, or null. |
Active
ServiceWorker.csInstalling
ServiceWorker.csGets the installing worker, or null.
public ServiceWorker? Installing { get; }OnUpdateFound
ServiceWorker.csGets or sets the event handler of the updatefound event.
Scope
ServiceWorker.csUpdateViaCache
ServiceWorker.csGets the update via cache mode.
public ServiceWorkerUpdateViaCache UpdateViaCache { get; }Waiting
ServiceWorker.csMethods
| Name | Description |
|---|---|
| Unregister() | Unregisters the registration (https://w3c.github.io/ServiceWorker/#dom-serviceworkerregistration-unregister). |
| Update() | Checks whether the script of the service worker changed (https://w3c.github.io/ServiceWorker/#dom-serviceworkerregistration-update). |
Unregister()
ServiceWorker.csUnregisters the registration (https://w3c.github.io/ServiceWorker/#dom-serviceworkerregistration-unregister).
Update()
ServiceWorker.csChecks whether the script of the service worker changed (https://w3c.github.io/ServiceWorker/#dom-serviceworkerregistration-update).
public Task<ServiceWorkerRegistration> Update()