InstallEventinterface represents an install action that is dispatched on the
ServiceWorker. As a child of
ExtendableEvent, it ensures that functional events such as
FetchEventare not dispatched during installation.
activeWorkerread-only property of the
InstallEventinterface returns the
ServiceWorkerthat is currently actively controlling the page.
InstallEvent()constructor creates a new
Navigator.serviceWorkerread-only property returns the
ServiceWorkerContainerobject for the associated document, which provides access to registration, removal, upgrade, and communication with the
ServiceWorkerinterface of the ServiceWorker API provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique
EventListenerproperty called whenever an event of type
statechangeis fired; it is basically fired anytime the
ServiceWorkerserialized script URL defined as part of
ServiceWorkerRegistration. Must be on the same origin as the document that registers the
stateread-only property of the
ServiceWorkerinterface returns a string representing the current state of the service worker. It can be one of the following values:
controllerread-only property of the
ServiceWorkerContainerinterface returns a
ServiceWorkerobject if its state is
activated(the same object returned by
ServiceWorkerRegistration.active). This property returns
nullif the request is a force refresh (Shift + refresh) or if there is no active worker.