ჩვენს მოხალისეებს, ჯერ არ შეუმუშავებიათ ამ სტატიის ქართული ვარიანტი. შემოგვიერთდით და დაგვეხმარეთ გადათარგმნაში!
ამასთან, შეგიძლიათ იხილოთ სტატიის English (US) ვერსია.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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.

Constructor

BeforeInstallPromptEvent()
Creates a new BeforeInstallPromptEvent.

Properties

Inherits properties from its parent, Event.

BeforeInstallPromptEvent.platforms Read only
Returns an array of DOMString items containing the platforms on which the event was dispatched. This is provided for user agents that want to present a choice of versions to the user such as, for example, "web" or "play" which would allow the user to chose between a web version or an Android version.
BeforeInstallPromptEvent.userChoice Read only
Returns a Promise that resolves to a DOMString containing either "accepted" or "dismissed".

Methods

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

Example

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 "accepted" or "dismissed"
  }, handleError); 
});

Specifications

Specification Status Comment
Web App Manifest
The definition of 'BeforeInstallPromptEvent' in that specification.
Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
BeforeInstallPromptEvent
Experimental
Chrome Full support 45Edge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android Full support 45Chrome Android Full support 45Edge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android Full support Yes
BeforeInstallPromptEvent() constructor
Experimental
Chrome Full support 45Edge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android Full support 45Chrome Android Full support 45Edge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
platforms
ExperimentalNon-standard
Chrome Full support 45Edge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android Full support 45Chrome Android Full support 45Edge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
prompt
Experimental
Chrome Full support 45Edge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android Full support 45Chrome Android Full support 45Edge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android Full support Yes
userChoice
Experimental
Chrome Full support 45Edge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android Full support 45Chrome Android Full support 45Edge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.

დოკუმენტების ჭდეები და წვლილის შემტანები

ამ გვერდის შექმნაში, წვლილის შემტანები: mdnwebdocs-bot, chrisdavidmills, connorshea, coox, jpmedley, marcoscaceres, rolfedh, jsx
ბოლო განახლების ავტორი: mdnwebdocs-bot,