Window: appinstalled event

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Want more browser support for this feature? Tell us why.

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.

Syntax

Use the event name in addEventListener():

js
addEventListener("appinstalled", (event) => { })

Alternatively, assign to the event handler property of the interface:

js
onappinstalled = (event) => { }

Event type

A generic Event.

Examples

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 (but note that this replaces other event listeners added using onappinstalled, if any):

js
window.onappinstalled = () => {
  console.log("Thank you for installing our app!");
};

Specifications

Specification
Manifest Incubations
# dom-window-onappinstalled

Browser compatibility