Notification.requireInteraction
注: この機能は Web Worker 内で利用可能です
安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。
requireInteraction
は Notification
インターフェイスの読取専用プロパティで、ユーザーがクリックするか閉じるかするまで、通知が自動的に閉じずに残るべきであることを示す Boolean
を返します。
注: これは最初に、 Notification.Notification()
コンストラクターの option オブジェクトの requireInteraction
が true
の状態で生成されたときに設定されることがあります。
構文
function spawnNotification(theTitle,theBody,shouldRequireInteraction) {
var options = {
body: theBody,
requireInteraction: shouldRequireInteraction
}
var n = new Notification(theTitle,options);
}
値
Boolean
です。
仕様書
仕様書 | 状態 | 備考 |
---|---|---|
Notifications API requireInteraction の定義 |
現行の標準 | Living standard |
ブラウザーの互換性
BCD tables only load in the browser