Notification.body

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

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

bodyNotification インターフェイスの読み取り専用プロパティで、 Notification() コンストラクターの body オプションで指定された通知の本文の文字列を返します。

文字列です。

js
function spawnNotification(theBody, theIcon, theTitle) {
  const options = {
    body: theBody,
    icon: theIcon,
  };
  const n = new Notification(theTitle, options);

  console.log(n.body);
}

仕様書

Specification
Notifications API Standard
# dom-notification-body

ブラウザーの互換性

BCD tables only load in the browser

関連情報