Skip to content

BeforeInstallPromptEvent #619

@marcoscaceres

Description

@marcoscaceres

WebKittens

@marcoscaceres @othermaciej @smfr @rniwa

Previously commented on related issues:

Title of the proposal

BeforeInstallPromptEvent API (for installing the "current app")

URL to the spec

https://www.w3.org/TR/appmanifest/

URL to the spec's repository

https://github.com/w3c/manifest

Issue Tracker URL

https://github.com/w3c/manifest/issues

Explainer URL

https://pr-preview.s3.amazonaws.com/w3c/manifest/pull/1206.html#installation-events

TAG Design Review URL

No response

Mozilla standards-positions issue URL

No response

WebKit Bugzilla URL

  • Bug 193959 - Original BIP request (2019, RESOLVED WONTFIX)
  • Bug 255716 - Duplicate with detailed discussion (2023)
  • Bug 198673 - Related: feature detection for "Add to Home Screen"

Radar URL

No response

Description

The BeforeInstallPromptEvent API enables web applications to:

  1. Detect installability - Know when a web app meets installation criteria
  2. Trigger native install UI - Call prompt() to open the browser's install dialog (e.g., Safari's Add to Home Screen sheet)
  3. Track user response - Know whether the user accepted or dismissed the installation

How It Works

  1. Once a page's manifest is processed and the page is deemed "installable" (UA-specific criteria), the browser fires beforeinstallprompt at the Window
  2. The site can call event.preventDefault() to suppress any automatic browser prompt
  3. The site can store the event and later call event.prompt() (requires user activation) to trigger the native install UI
  4. The promise resolves with the user's choice (accepted or dismissed)

What Has Changed since BIP was removed from the Web Manifest spec

  1. "When would it fire?" → Deterministically, only on pages that have an explicit manifest. And only once manifest is processed and page is installable. No complex heuristics required.
  2. "Safari has no install prompt" → The event is decoupled from automatic prompts. It simply signals installability. prompt() (requiring transient user activation) can trigger Safari's existing Add to Home Screen sheet.
  3. "Risk of abuse" → User activation is required for prompt(). Developers control whether to show install UI at all.

Chrome Experiment Data (Dan Murphy, Chrome team)

  • Browser-native ambient UI (omnibox icon): ~0.01% CTR
  • Browser-initiated blocking prompts: ~1.2% CTR
  • ML targeting reduced prompt show rate by 70% with same install rate (most prompts go to uninterested users)

This data shows browser-initiated UI has very low engagement. This could support the case for developer control, or alternatively suggest most users don't want to install web apps.

Proposed User Benefits of BIP

  • Users discover installability at contextually appropriate moments, not arbitrary browser-chosen times. However, this only applies if the browser shows an intrusive UI.
  • Users avoid installation prompts during critical tasks (checkout, form completion, etc.). Not a concern if the browser never prompts.

User Harm from Current Workarounds

Sites resort to workarounds that harm users:

  • Browser sniffing is fragile - Sites detect Safari via User-Agent and show manual installation instructions, but this breaks when UA strings change or on non-Safari WebKit browsers.
  • Static screenshots become outdated - Installation instructions include screenshots of Safari's share sheet, which become incorrect when the UI changes across iOS/macOS versions
  • "Add to Home Screen" moves around - The option's location in the share sheet is not consistent across platforms and browser versions, leading to user confusion when following outdated guides
  • Users see wrong instructions - Combining the above, users frequently encounter installation guides showing the wrong screenshots for their Safari/iOS version

BIP eliminates this class of user-facing bugs by allowing sites to detect installability programmatically and trigger native UI directly, rather than attempting to describe ever-changing browser UI.

Web Compatibility

  • BIP has shipped in Chromium-based browsers for approximately 10 years
  • Sites already use it with progressive enhancement (feature detection)
  • Safari users currently receive a degraded experience: static instructions instead of a functional install flow
  • Standardizing the API aligns Safari with existing web reality and allows sites to provide a consistent, correct experience across browsers

Metadata

Metadata

Assignees

No one assigned

    Labels

    concerns: API designThe API for this is error-prone, poorly named, or inconsistent with the platformconcerns: annoyanceThe technology described in this proposal could be used to do things that may annoy the userconcerns: complexityThis proposal seems needlessly complexconcerns: usabilityThis proposal will create usability issues for users

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions