notifications

OS の通知メカニズムを使って、ユーザーへの通知を表示します。この API は OS の通知メカニズムを使うため、OS とユーザー設定によって通知の現れ方やふるまいは変わってきます。

この API を使うには "notifications" パーミッションが必要です。

すべてのデスクトップ OS で通知は同じ見た目です。次のようなものです:

notifications.NotificationOptions (en-US)

通知の中身を定義します。

notifications.TemplateType (en-US)

通知の種類。例えば、通知に画像を含められるかなどを定義します。

関数

notifications.clear() (en-US)

ID に基づいた特定の通知をクリアします。

notifications.create() (en-US)

新規の通知を作成、表示します。

notifications.getAll() (en-US)

すべての通知を取得します。

notifications.update() (en-US)

通知を更新します。

イベント

notifications.onButtonClicked (en-US)

ユーザーが通知内のボタンをクリックしたときに発火します。

notifications.onClicked (en-US)

ユーザーが通知内のボタン以外をクリックしたときに発火します。

notifications.onClosed (en-US)

通知が閉じたとき、システムかユーザーいずれかがやめた場合にも、発火します。

notifications.onShown (en-US)

通知が表示されるとすぐに発火します。

ブラウザーの互換性

BCD tables only load in the browser

Example extensions