Glossary

Definition

beforeinstallprompt

Short definition

beforeinstallprompt is a window event Chromium browsers fire when a site meets the PWA install criteria. Capturing the event and calling prompt() later lets you show the install dialog at a moment of your choosing instead of at page load.

Reviewed July 8, 2026

Firefox and Safari do not fire beforeinstallprompt — iOS install still requires a manual share-sheet guide.

The event can only be prompted in response to a user gesture (click, tap). Calling prompt() from a timer or on load throws.

After prompt() resolves, the deferred event is single-use. Store the userChoice outcome and hide any custom install UI accordingly.