Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. ServiceWorkerContainer
  4. getRegistrations()

ServiceWorkerContainer: getRegistrations() method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨April 2018⁩.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Note: This feature is available inWeb Workers.

ThegetRegistrations() method of theServiceWorkerContainer interface gets allServiceWorkerRegistrations associated with aServiceWorkerContainer, in an array. The method returns aPromise that resolves to an array ofServiceWorkerRegistration.

Syntax

js
getRegistrations()

Parameters

None.

Return value

APromise that resolves to an array ofServiceWorkerRegistration objects.

Examples

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

Specifications

Specification
Service Workers Nightly
# navigator-service-worker-getRegistrations

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp