--- title: 'Window: appinstalled イベント' slug: Web/API/Window/appinstalled_event tags: - API - Event - Manifest - Reference - Web - appinstalled - events - web manifest - ウェブマニフェスト - マニフェスト translation_of: Web/API/Window/appinstalled_event ---
appinstalled は Web Manifest API のイベントで、ブラウザーがあるページをアプリケーションとして成功裏にインストールしたとき発行されます。
| バブリング | なし |
|---|---|
| キャンセル | 不可 |
| インターフェイス | {{domxref("Event")}} |
| イベントハンドラー | {{domxref("Window/onappinstalled", "onappinstalled")}} |
appinstalled イベントは {{domxref("EventTarget/addEventListener", "addEventListener")}} メソッドで使用することができます。
window.addEventListener('appinstalled', function() {
console.log('アプリをインストールしてくれてありがとう!');
});
または {{domxref("Window/onappinstalled", "onappinstalled")}} イベントハンドラープロパティを使用してください。
window.onappinstalled = function() {
console.log('アプリをインストールしてくれてありがとう!');
};
| 仕様書 | 状態 |
|---|---|
| {{SpecName('Manifest', '#dfn-appinstalled', 'appinstalled')}} | {{Spec2('Manifest')}} |
{{Compat("api.Window.onappinstalled")}}