MDN’s new design is in Beta! A sneak peek:


This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The BeforeInstallPromptEvent is fired at the Window.onbeforeinstallprompt handler before a user is prompted to "install" a web site to a home screen on mobile.

This interface inherits from the Event interface.


new window.BeforeInstallPromptEvent(name, eventInitOptions)
Creates a new BeforeInstallPromptEvent.


Inherits properties from its parent, Event.

BeforeInstallPromptEvent.platform Read only
Returns a DOMString containing the platform on which the event was dispatched.
BeforeInstallPromptEvent.userChoice Read only
Returns a Promise that resolves to a DOMString containing either 'installed' or 'dismissed'.


Allows a developer to show the install prompt at a time of their own choosing. This method returns a  Promise.


window.addEventListener("beforeinstallprompt", function(e) { 
  // log the platforms provided as options in an install prompt 
  console.log(e.platforms); // e.g., ["web", "android", "windows"] 
  e.userChoice.then(function(outcome) { 
    console.log(outcome); // either "installed", "dismissed", etc. 
  }, handleError); 

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support

44.0 [1]

No support No support No support No support
prompt() method. 45.0 [1] No support No support No support No support
Feature Android Android Webview Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support No support

44.0 [1]

No support No support No support No support

44.0 [1]

prompt() method. No support 45.0 [1] No support No support No support No support 45.0 [1]

[1] Behind the flagchrome://flags/#bypass-app-banner-engagement-checks

Document Tags and Contributors

 Contributors to this page: marcoscaceres, jpmedley, rolfedh, jsx
 Last updated by: marcoscaceres,