We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

InstallEvent.activeWorker

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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;
});

Specifications

Specification Status Comment
Service Workers
The definition of 'InstallEvent' in that specification.
Working Draft Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support40 ?441 No27 No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support4040 ?4427 No4.0

1. Service workers (and Push) have been disabled in the Firefox 45 & 52 Extended Support Releases (ESR).

See also

Document Tags and Contributors

Contributors to this page: fscholz, chrisdavidmills, Sebastianz, kscarfone
Last updated by: fscholz,