Window.onappinstalled

Limited availability

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

Window 对象的 onappinstalled 属性用于处理 appinstalled 事件,该事件是一个实现了 Event接口的简单事件,会在网页应用成功安装为渐进式网页应用时立即触发。

语法

window.onappinstalled = function(event) { ... };

示例

js
window.onappinstalled = function (ev) {
  console.log("The application was installed.");
};

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
appinstalled event

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

相关文章