ServiceWorkerGlobalScope Class
The global object of a service worker (https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope-interface): it receives the lifecycle events (install, activate) and the functional events (fetch, message) of its service worker. It runs on the thread of the service worker (see WorkerGlobalScope).
public sealed class ServiceWorkerGlobalScope : WorkerGlobalScope- Inheritance
WorkerGlobalScopeServiceWorkerGlobalScope
Properties
| Name | Description |
|---|---|
| Clients | Gets the clients of the service worker (https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-clients). |
| OnActivate | Gets or sets the event handler of the activate event. |
| OnFetch | Gets or sets the event handler of the fetch event. |
| OnInstall | Gets or sets the event handler of the install event. |
| OnMessage | Gets or sets the event handler of the message event. |
| OnMessageError | Gets or sets the event handler of the messageerror event. |
| Registration | Gets the registration of the service worker (https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-registration). |
| ServiceWorker | Gets the service worker (https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-serviceworker). |
Clients
ServiceWorkerGlobalScope.csGets the clients of the service worker (https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-clients).
public Clients Clients { get; }Property value
See also
OnActivate
ServiceWorkerGlobalScope.csGets or sets the event handler of the activate event.
OnFetch
ServiceWorkerGlobalScope.csGets or sets the event handler of the fetch event.
Property value
See also
OnInstall
ServiceWorkerGlobalScope.csGets or sets the event handler of the install event.
OnMessage
ServiceWorkerGlobalScope.csGets or sets the event handler of the message event.
OnMessageError
ServiceWorkerGlobalScope.csGets or sets the event handler of the messageerror event.
Registration
ServiceWorkerGlobalScope.csGets the registration of the service worker (https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-registration).
public ServiceWorkerRegistration Registration { get; }ServiceWorker
ServiceWorkerGlobalScope.csGets the service worker (https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-serviceworker).
public ServiceWorker ServiceWorker { get; }Methods
| Name | Description |
|---|---|
| SkipWaiting() | Activates the service worker without waiting for the clients of the active worker to be unloaded (https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-skipwaiting). |
SkipWaiting()
ServiceWorkerGlobalScope.csActivates the service worker without waiting for the clients of the active worker to be unloaded (https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-skipwaiting).
public Task SkipWaiting()