Window: appinstalled イベント
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
appinstalled
はウェブマニフェスト API のイベントで、ブラウザーがあるページをアプリケーションとして成功裏にインストールしたとき発行されます。
このイベントはキャンセル不可で、バブリングしません。
構文
このイベント名を addEventListener()
などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。
js
addEventListener("appinstalled", (event) => {});
onappinstalled = (event) => {};
イベント型
一般的な Event
です。
例
appinstalled
イベントは addEventListener
メソッドで使用することができます。
js
window.addEventListener("appinstalled", () => {
console.log("アプリをインストールしてくれてありがとう!");
});
または onappinstalled
イベントハンドラープロパティを使用してください。
js
window.onappinstalled = () => {
console.log("アプリをインストールしてくれてありがとう!");
};
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
appinstalled event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
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.