2

ServiceWorkerGlobalScope - Web APIs | MDN

 1 year ago
source link: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

ServiceWorkerGlobalScope

The ServiceWorkerGlobalScope interface of the Service Worker API represents the global execution context of a service worker.

Developers should keep in mind that the ServiceWorker state is not persisted across the termination/restart cycle, so each event handler should assume it's being invoked with a bare, default global state.

Once successfully registered, a service worker can and will be terminated when idle to conserve memory and processor power. An active service worker is automatically restarted to respond to events, such as fetch or message.

Additionally, synchronous requests are not allowed from within a service worker — only asynchronous requests, like those initiated via the fetch() method, can be used.

This interface inherits from the WorkerGlobalScope interface, and its parent EventTarget.

EventTarget WorkerGlobalScope ServiceWorkerGlobalScope


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK