过时
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.');
};
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
onappinstalled
弃用
非标
|
Chrome 64 | Edge ≤79 |
Firefox
49 — 76
Disabled
|
IE ? | Opera No | Safari ? | WebView Android No | Chrome Android 57 | Firefox Android 49 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
完整支持
不支持
兼容性未知
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
用户必须明确启用此特征。