Firefox Tomorrow

web api instance method

ServiceWorkerContainer: getRegistrations() method

View on MDN ↗

Secure contextAvailable in workers

The getRegistrations() method of the ServiceWorkerContainer interface gets all ServiceWorkerRegistrations associated with a ServiceWorkerContainer, in an array. The method returns a Promise that resolves to an array of ServiceWorkerRegistration.

Syntax

getRegistrations()

Parameters

None.

Return value

A Promise that resolves to an array of ServiceWorkerRegistration objects.

Examples

navigator.serviceWorker.getRegistrations().then((registrations) => {
  document.querySelector("#status").textContent =
    "ServiceWorkerRegistrations found.";
});

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.