--- title: Window.onappinstalled slug: Web/API/Window/appinstalled_event translation_of: Web/API/Window/onappinstalled original_slug: Web/API/Window/onappinstalled ---
{{domxref("Window")}} 对象的 onappinstalled
属性用于处理 {{Event("appinstalled")}} 事件,该事件是一个实现了 {{domxref("Event")}}接口的简单事件,会在网页应用成功安装为渐进式网页应用时立即触发。
window.onappinstalled = function(event) { ... };
window.onappinstalled = function(ev) { console.log('The application was installed.'); };
Specification | Status | Comment |
---|---|---|
{{SpecName('Manifest', '#onappinstalled-attribute', 'Window.onappinstalled')}} | {{Spec2('Manifest')}} | Initial specification. |