-
Notifications
You must be signed in to change notification settings - Fork 36
Description
WebKittens
@marcoscaceres @othermaciej @smfr @rniwa
Previously commented on related issues:
- Ryosuke Niwa (@rniwa) - Issue #835, PR #836
- Maciej Stachowiak (@othermaciej) - Bug 193959, PR #836
- Marcos Caceres (@marcoscaceres) - Bug 255716
- Simon Fraser (@smfr) - Bug 198673
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:
- Detect installability - Know when a web app meets installation criteria
- Trigger native install UI - Call
prompt()to open the browser's install dialog (e.g., Safari's Add to Home Screen sheet) - Track user response - Know whether the user accepted or dismissed the installation
How It Works
- Once a page's manifest is processed and the page is deemed "installable" (UA-specific criteria), the browser fires
beforeinstallpromptat the Window - The site can call
event.preventDefault()to suppress any automatic browser prompt - The site can store the event and later call
event.prompt()(requires user activation) to trigger the native install UI - The promise resolves with the user's choice (
acceptedordismissed)
What Has Changed since BIP was removed from the Web Manifest spec
- "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.
- "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. - "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