JavaScript Navigator getInstalledRelatedApps() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Method

Definition

navigator.getInstalledRelatedApps() returns a Promise that resolves to an array of related installed apps (MDN) — Play / Windows / PWA entries you declared — so you can hide “Install our app” UI when the user already has it.

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

Syntax

Call navigator.getInstalledRelatedApps. Start with this line.

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

Built into the browser. Call getInstalledRelatedApps(...) on a Navigator — no import required.

Library declarations
JavaScript
navigator.getInstalledRelatedApps()

Parameters

ParameterDescription
ManifestRequired. related_applications + platform link
ContextRequired. Secure + top-level (not iframe)

Return Value

Return ValueDescription
*Promise → array (may be empty)

JavaScript Examples

Example 1 — Feature Detection

Check API support, secure context, and top-level browsing context.

JavaScript
const lines = [
  "getInstalledRelatedApps: " +
    (typeof navigator.getInstalledRelatedApps === "function"
      ? "available"
      : "missing"),
  "isSecureContext: " + window.isSecureContext,
  "topLevel: " + (window.top === window.self)
];
console.log(lines.join("\n"));
Try It Yourself

How It Works

  1. Test the method. Chromium-family browsers may expose it; Firefox and Safari usually do not.
  2. Check HTTPS. isSecureContext must be true for the API.
  3. Confirm top-level. window.top === window.self means you are not in an iframe.
  4. Then call. Only proceed when all three checks look good.

Example 2 — Query Related Apps

Await the Promise and print each installed related app.

JavaScript
async function listRelatedApps() {
  if (typeof navigator.getInstalledRelatedApps !== "function") {
    return ["getInstalledRelatedApps not supported"];
  }
  const apps = await navigator.getInstalledRelatedApps();
  if (!apps.length) {
    return ["No related apps reported (empty array is common)"];
  }
  return apps.map(
    (app) =>
      (app.platform || "?") +
      " | id=" + (app.id || "n/a") +
      " | url=" + (app.url || "n/a")
  );
}

listRelatedApps().then((lines) => console.log(lines.join("\n")));
Try It Yourself

How It Works

  1. Feature-detect first. Avoid calling a missing method.
  2. Await the Promise. The result is always an array.
  3. Handle empty. No association or no install → [].
  4. Map a short label. Show platform, id, and url.

Example 3 — Find by Id (MDN)

MDN pattern: search the array for a specific platform app id.

JavaScript
async function findRelatedApp(targetId) {
  if (typeof navigator.getInstalledRelatedApps !== "function") {
    return "API missing";
  }
  const relatedApps = await navigator.getInstalledRelatedApps();
  const psApp = relatedApps.find((app) => app.id === targetId);
  if (!psApp) {
    return "Not installed (or not associated): " + targetId;
  }
  return "Installed: " + psApp.platform + " " + (psApp.version || "");
}

findRelatedApp("com.example.myapp").then(console.log);
Try It Yourself

How It Works

  1. Await the list. Same MDN starting point as console.table(relatedApps).
  2. Use find. Match your package / store id.
  3. Branch on the result. Present → customize; missing → default UX.
  4. Optional version. MDN shows checking psApp.version for feature gates.

Example 4 — Hide Install Banner

Skip a custom install prompt when any related app is already installed.

JavaScript
async function shouldShowInstallBanner() {
  if (typeof navigator.getInstalledRelatedApps !== "function") {
    return true; // API missing → keep your normal banner
  }
  try {
    const apps = await navigator.getInstalledRelatedApps();
    return apps.length === 0;
  } catch (err) {
    return true; // e.g. InvalidStateError in iframe
  }
}

shouldShowInstallBanner().then((show) => {
  console.log(show ? "Show install banner" : "Hide install banner");
});
Try It Yourself

How It Works

  1. Default to showing. Missing API → keep the normal install UX.
  2. Await related apps. Any entry means the user already has a related install.
  3. Hide when length > 0. Avoid nagging users who already installed.
  4. Catch errors. Iframes and other failures should not break the page.

Example 5 — Safe Guard Helper

Wrap detect + await + catch in one reusable helper for students.

JavaScript
async function getRelatedAppsSafe() {
  if (typeof navigator.getInstalledRelatedApps !== "function") {
    return { ok: false, reason: "unsupported", apps: [] };
  }
  if (!window.isSecureContext) {
    return { ok: false, reason: "insecure", apps: [] };
  }
  if (window.top !== window.self) {
    return { ok: false, reason: "not-top-level", apps: [] };
  }
  try {
    const apps = await navigator.getInstalledRelatedApps();
    return { ok: true, reason: "ok", apps: apps };
  } catch (err) {
    return { ok: false, reason: err.name || "error", apps: [] };
  }
}

getRelatedAppsSafe().then((result) => {
  console.log(result.reason + " | count=" + result.apps.length);
});
Try It Yourself

How It Works

  1. Gate on support. Return early with a clear reason string.
  2. Gate on secure + top-level. Matches MDN requirements before calling.
  3. Try / catch the await. Surfaces InvalidStateError safely.
  4. Always return apps. Callers can branch on ok and apps.length.

Browser Support

navigator.getInstalledRelatedApps() is part of the Get Installed Related Apps API. MDN marks it Experimental and Limited availability (not Baseline). Chromium browsers support it with platform/PWA caveats; Firefox and Safari do not. Requires a secure, top-level context and a verified related_applications association.

✓ Experimental · Limited availability

Navigator.getInstalledRelatedApps()

Promise of related installed platform apps / PWAs for install UX.

45% Limited modern support
Google Chrome Related apps · ~85+ (platform caveats)
Limited
Microsoft Edge Related apps · ~85+ (platform caveats)
Limited
Apple Safari Not supported
Unavailable
Opera Follow Chromium related-apps
Limited
Mozilla Firefox Not supported
Unavailable
Internet Explorer No Get Installed Related Apps API
Unavailable
getInstalledRelatedApps() Limited

Bottom line: Feature-detect, require HTTPS + top-level, and keep a normal install banner when the API or association is missing.

Frequently Asked Questions

It returns a Promise that resolves to an array of objects for related platform apps or PWAs the user already installed — useful to hide “install our app” prompts when the app is already present.
MDN marks it Experimental and Limited availability (not Baseline). It is not Deprecated or Non-standard. Always feature-detect and keep a normal install UX fallback.
List related apps in the web app manifest related_applications member, and define the relationship on the platform side (for example Digital Asset Links on Android, URI handlers on Windows, or PWA self-entries / assetlinks).
Yes. It requires a secure context. It must also run in a top-level browsing context — not inside an iframe (InvalidStateError otherwise).
At least platform; optionally id, url, and version. Platform values include play, windows, webapp, chrome_web_store, and others documented on MDN.
Usually no. Without a matching manifest association and a supporting browser, you get an empty array or a missing method. That is expected for beginners testing outside a configured PWA.

Next: getUserMedia()

Learn how to request camera and microphone media streams from Navigator.

getUserMedia() →

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