JavaScript PushManager registrations() Method

Beginner
5 min read
Updated: Nov 2026
4 examples
Method

Definition

PushManager.registrations() was a legacy instance method that asked the system for existing push endpoint registrations. On success, req.result was an array of plain PushRegistration objects with pushEndpoint and version (MDN).

Pass the required arguments shown below. Check return values and browser support before you rely on the result.

Syntax

Call pushManager.registrations. Start with this line.

JavaScript
pushManager.registrations()
CallWhat it does
pushManager.registrations()Primary signature.
pushManager.registrations(...)Call with the arguments your case needs.

Built into the browser. Call registrations(...) on a PushManager — no import required.

Library declarations
JavaScript
pushManager.registrations()

Parameters

ParameterDescription
onsuccess / onerrorRequired. Handle the DOMRequest
Feature detectRequired. Missing in modern browsers

Return Value

Return ValueDescription
*DOMRequest (not a Promise)

JavaScript Examples

Example 1 — MDN registrations() Loop

List existing endpoints with pushEndpoint and version.

JavaScript
const req = navigator.push.registrations();

req.onsuccess = () => {
  if (req.result.length > 0) {
    req.result.forEach((registration) => {
      console.log(
        `Existing registration ${registration.pushEndpoint} ${registration.version}`
      );
    });
  } else {
    console.log("No existing registrations");
  }
};
Try It Yourself

How It Works

  1. Call the legacy API. registrations() returns a DOMRequest, not a Promise.
  2. Wait for success. onsuccess runs when the system finishes the query.
  3. Read the array. Each item has pushEndpoint (URL) and version.
  4. Handle empty. Length 0 means no endpoints yet — legacy code often called register() next.

Example 2 — Feature Detect Before Calling

Safe pattern when you must touch legacy codepaths.

JavaScript
function legacyRegistrations(pushManager) {
  if (pushManager && typeof pushManager.registrations === "function") {
    return pushManager.registrations();
  }
  if (navigator.push && typeof navigator.push.registrations === "function") {
    return navigator.push.registrations();
  }
  return null; // not supported — use getSubscription()
}

const req = legacyRegistrations(null);
console.log(req === null ? "use getSubscription()" : "legacy available");
Try It Yourself

How It Works

  1. Check the method. Only call if typeof … === "function".
  2. Cover both hosts. Old samples used navigator.push; some drafts used pushManager.
  3. Return null when missing. That is the common case in Chrome, Safari, and modern Firefox.
  4. Fall forward. Treat null as a signal to use getSubscription().

Example 3 — Reuse Endpoints or Call register()

MDN’s historical “list or create” flow (do not ship this).

JavaScript
const req = navigator.push.registrations();

req.onsuccess = () => {
  if (req.result.length > 0) {
    req.result.forEach((r) => {
      console.log("Reuse:", r.pushEndpoint);
    });
  } else {
    const registerReq = navigator.push.register();
    registerReq.onsuccess = () => {
      console.log(`Registered new endpoint: ${registerReq.result}`);
    };
  }
};
Try It Yourself

How It Works

  1. Query first. Legacy apps avoided creating duplicate endpoints.
  2. Reuse when present. Send each pushEndpoint to the app server.
  3. Create when empty. Empty array triggered deprecated register().
  4. Modern twin. getSubscription() then subscribe() if null.

Example 4 — Migrate to getSubscription()

Recommended replacement for new push projects.

JavaScript
const registration = await navigator.serviceWorker.ready;
const subscription = await registration.pushManager.getSubscription();

if (subscription) {
  console.log("Existing:", subscription.endpoint);
} else {
  console.log("Not subscribed — show enable UI");
}
Try It Yourself

How It Works

  1. Wait for the worker. navigator.serviceWorker.ready gives the active registration.
  2. Read one subscription. getSubscription() returns a Promise — not a DOMRequest.
  3. Handle null. No subscription yet → show enable UI, then call subscribe().
  4. Use the full object. Modern servers need endpoint and encryption keys, not only a URL string.

Browser Support

PushManager.registrations() is Deprecated and Non-standard on MDN. It is missing or removed in modern browsers. Prefer getSubscription() (Baseline Widely available).

✓ Deprecated · Non-standard

PushManager.registrations()

Legacy push endpoint listing — avoid in new code. Use getSubscription() instead.

Legacy Deprecated API
Google Chrome Not supported — use getSubscription()
Not supported
Mozilla Firefox Legacy only — use getSubscription()
Legacy only
Apple Safari Never supported — use getSubscription()
Not supported
Microsoft Edge Follow Chromium — use getSubscription()
Not supported
Opera Follow Chromium
Not supported
Internet Explorer No Push API
Not supported
registrations() Limited

Bottom line: Feature-detect before calling. Build new push features with getSubscription() and subscribe() after serviceWorker.ready.

Frequently Asked Questions

It asked the system about existing push endpoint registrations. On success, the DOMRequest result was an array of PushRegistration objects with pushEndpoint and version.
Yes. MDN marks it Deprecated and Non-standard. It is not Experimental. Prefer PushManager.getSubscription() in new code.
A DOMRequest object (legacy Mozilla pattern), not a Promise. On success, req.result is an array of objects with pushEndpoint (URL string) and version.
Use PushManager.getSubscription() after navigator.serviceWorker.ready. It returns a Promise that resolves to a PushSubscription or null.
No. MDN documents registrations() with no parameters.
You may see it paired with register() in old Mozilla push samples. Knowing it helps you migrate safely to getSubscription() and subscribe().

Next: getSubscription()

Learn the modern way to check for an existing push subscription.

getSubscription() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

9 people found this page helpful