Window.onappinstalled

翻译正在进行中。

Window 对象的 onappinstalled 属性用于处理 appinstalled  事件处理程序。 PWA 成功安装时被触发一次。被触发的是一个实现 Event 接口的简单事件。

语法

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

示例

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

规范

Specification Status Comment
Web App Manifest
Window.onappinstalled
Working Draft Initial specification.

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support ? 49 (49) [1] ? ? ?
Feature Android Android Webview Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ? ? 49.0 (49) [1] ? ? ? ?

[1] This feature is behind a feature preference setting. In about:config, set dom.manifest.onappinstall to true.

相关文章

文档标签和贡献者

标签: 
 此页面的贡献者: echoArray
 最后编辑者: echoArray,