此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。
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) { ... };
window.onappinstalled = function (ev) {
console.log("The application was installed.");
};