Notification.maxActions

注: この機能は Web Worker 内で利用可能です。

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。

Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。

maxActionsNotification インターフェイスの属性で、端末とユーザーエージェントが対応するアクションの最大数を返します。実質的には、これはユーザーエージェントが尊重する Notification.actions 配列の最大数です。

整数で、ユーザ-エージェントと端末がユーザーに提示することができるできる通知アクションの最大数を示します。

以下のスニペットは、対応するアクションの最大数をログ出力します。

js
const maxActions = Notification.maxActions;
console.log(
  `This device can display at most ${maxActions} actions on each notification.`,
);

仕様書

Specification
Notifications API Standard
# dom-notification-maxactions

ブラウザーの互換性

BCD tables only load in the browser

関連情報