oninstall
handler, the InstallEvent
interface represents an install action that is dispatched on the ServiceWorkerGlobalScope
of a ServiceWorker
. As a child of ExtendableEvent
, it ensures that functional events such as FetchEvent
are not dispatched during installation. activeWorker
read-only property of the InstallEvent
interface returns the ServiceWorker
that is currently actively controlling the page.InstallEvent()
constructor creates a new InstallEvent
object.Navigator.serviceWorker
read-only property returns the ServiceWorkerContainer
object for the associated document, which provides access to registration, removal, upgrade, and communication with the ServiceWorker
.ServiceWorker
interface 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 ServiceWorker
object.EventListener
property called whenever an event of type statechange
is fired; it is basically fired anytime the ServiceWorker.state
changes.ServiceWorker
serialized script URL defined as part of ServiceWorkerRegistration
. Must be on the same origin as the document that registers the ServiceWorker
.state
read-only property of the ServiceWorker
interface returns a string representing the current state of the service worker. It can be one of the following values: installing
, installed,
activating
, activated
, or redundant
.controller
read-only property of the ServiceWorkerContainer
interface returns a ServiceWorker
object if its state is activated
(the same object returned by ServiceWorkerRegistration.active
). This property returns null
if the request is a force refresh (Shift + refresh) or if there is no active worker.