The appinstalled
event of the Web Manifest API is fired when the browser has successfully installed a page as an application.
This event is not cancelable and does not bubble.
The appinstalled
event of the Web Manifest API is fired when the browser has successfully installed a page as an application.
This event is not cancelable and does not bubble.
Use the event name in methods like addEventListener()
, or set an event handler property.
js
addEventListener("appinstalled", (event) => {}); onappinstalled = (event) => {};
A generic Event
.
You can use the appinstalled
event in an addEventListener
method:
js
window.addEventListener("appinstalled", () => { console.log("Thank you for installing our app!"); });
Or use the onappinstalled
event handler property:
js
window.onappinstalled = () => { console.log("Thank you for installing our app!"); };
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
appinstalled_event |
64 | 79 | No | No | NoOpera exposes theonappinstalled event handler, but the event is never fired. |
No | 57 | 57 | No | NoOpera exposes theonappinstalled event handler, but the event is never fired. |
No | 7.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Window/appinstalled_event