Window: appinstalled event
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Theappinstalled
event of theWeb Manifest API is fired when the browser has successfully installed a page as an application.
This event is not cancelable and does not bubble.
Syntax
Use the event name in methods likeaddEventListener()
, or set an event handler property.
js
addEventListener("appinstalled", (event) => { })onappinstalled = (event) => { }
Event type
A genericEvent
.
Examples
You can use theappinstalled
event in anaddEventListener
method:
js
window.addEventListener("appinstalled", () => { console.log("Thank you for installing our app!");});
Or use theonappinstalled
event handler property:
js
window.onappinstalled = () => { console.log("Thank you for installing our app!");};
Specifications
Specification |
---|
Manifest Incubations # dom-window-onappinstalled |