过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

onappinstalled attribute of the Window object serves as an event handler for the appinstalled event, which is dispatched once the web application is successfully installed as a progressive web app . The event that is fired is a "simple event" that implements the 事件 接口。

句法

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

范例

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

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
onappinstalled 弃用 非标 Chrome 64 Edge ≤79 Firefox 49 — 76 Disabled
不支持 49 — 76 Disabled
Disabled ). To change preferences in Firefox, visit
IE ? Opera No Safari ? WebView Android No Chrome Android 57 Firefox Android 49 Opera Android No Safari iOS ? Samsung Internet Android No

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

弃用。不要用于新网站。

弃用。不要用于新网站。

用户必须明确启用此特征。

用户必须明确启用此特征。

另请参阅

元数据

  • 最后修改: