title | short-title | slug | page-type | browser-compat |
---|---|---|---|---|
Window: appinstalled event |
appinstalled |
Web/API/Window/appinstalled_event |
web-api-event |
api.Window.appinstalled_event |
{{APIRef}}
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 {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.
addEventListener("appinstalled", (event) => {});
onappinstalled = (event) => {};
A generic {{domxref("Event")}}.
You can use the appinstalled
event in an {{domxref("EventTarget/addEventListener", "addEventListener")}} method:
window.addEventListener("appinstalled", () => {
console.log("Thank you for installing our app!");
});
Or use the onappinstalled
event handler property:
window.onappinstalled = () => {
console.log("Thank you for installing our app!");
};
{{Specifications}}
{{Compat}}