Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishwillee authored Dec 17, 2023
1 parent 08f0570 commit 4a381e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion files/en-us/web/api/serviceworker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ browser-compat: api.ServiceWorker

The **`ServiceWorker`** interface of the [Service Worker API](/en-US/docs/Web/API/Service_Worker_API) provides a reference to a service worker. Multiple {{glossary("browsing context", "browsing contexts")}} (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique `ServiceWorker` object.

A `ServiceWorker` object is available via the {{domxref("ServiceWorkerRegistration.active")}} property, the {{domxref("ServiceWorkerGlobalScope.serviceWorker")}} property and the {{domxref("ServiceWorkerContainer.controller")}} property when the service worker is in `activating` or `activated` state, and via {{domxref("ServiceWorkerRegistration.installing")}} property when the service worker is in `installing` state, or via {{domxref("ServiceWorkerRegistration.waiting")}} property when the service worker is in `installed` state.
A `ServiceWorker` object is available via a number of propertes:

- {{domxref("ServiceWorkerRegistration.active")}}
- {{domxref("ServiceWorkerGlobalScope.serviceWorker")}}
- {{domxref("ServiceWorkerContainer.controller")}} — when the service worker is in `activating` or `activated` state
- {{domxref("ServiceWorkerRegistration.installing")}} — when the service worker is in `installing` state
- {{domxref("ServiceWorkerRegistration.waiting")}} — when the service worker is in `installed` state

The `ServiceWorker` interface is dispatched a set of lifecycle events — `install` and `activate` — and functional events including `fetch`. A `ServiceWorker` object has an associated {{domxref("ServiceWorker.state")}}, related to its lifecycle.

Expand Down

0 comments on commit 4a381e1

Please sign in to comment.