demo · v139
Install Call
Programmatic install for web apps. Replaces the bespoke beforeinstallprompt event handler with an explicit await. Cross-origin install is gated on user activation. Probe support and try a real call below.
Origin trial. To actually trigger an install dialog: enable chrome://flags/#web-app-installation-api or register your origin in the trial. The demo always attempts the call and shows the rejection cleanly if unavailable.
Click "Probe" to feature-detect.
awaiting call…
the code
// Same-origin (no manifest URL):
const result = await navigator.install();
// Cross-origin (gated on user activation + trust):
const result = await navigator.install("https://app.example/manifest.json");
if (result?.mode === "installed") celebrate();