InstallEvent.activeWorker

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The activeWorker read-only property of the InstallEvent interface returns the ServiceWorker that is currently actively controlling the page.

This will return null if no active worker is already controlling the page.

Syntax

var myActiveWorker = event.activeWorker

Value

A ServiceWorker object.

Examples

self.addEventListener('install', function(event) {
  var myActiveWorker = event.activeWorker;
});

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
activeWorker
Experimental
Chrome Full support 40Edge Full support ≤79Firefox Full support 44
Notes
Full support 44
Notes
Notes Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.
IE No support NoOpera Full support 27Safari No support NoWebView Android Full support 40Chrome Android Full support 40Firefox Android Full support 44Opera Android Full support 27Safari iOS No support NoSamsung Internet Android Full support 4.0

Legend

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.

See also