ServiceWorkerRegistration: updatefound event

The updatefound event of the ServiceWorkerRegistration interface is fired any time the ServiceWorkerRegistration.installing property acquires a new service worker.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener('updatefound', event => { });

onupdatefound = event => { };

Event type

A generic Event.

Examples

const registration = await navigator.serviceWorker.getRegistration();
if (registration) {
    registration.addEventListener('updatefound', () => {
        console.log('Service Worker update found!');
    });
}

Specifications

No specification found

No specification data found for api.ServiceWorkerRegistration.updatefound_event.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser compatibility

No compatibility data found for api.ServiceWorkerRegistration.updatefound_event.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.

See also