Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.14 KB

File metadata and controls

53 lines (35 loc) · 1.14 KB
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.

Syntax

Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.

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

onappinstalled = (event) => {};

Event type

A generic {{domxref("Event")}}.

Examples

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

{{Specifications}}

Browser compatibility

{{Compat}}