notifications.TemplateType

Dies ist ein String und repräsentiert den Typ der Benachrichtigung, die erstellt werden soll. Es gibt vier Arten von Benachrichtigungen: "basic", "image", "list", "progress".

Dies wird als type-Eigenschaft von NotificationOptions in notifications.create() und notifications.update() übergeben.

Typ

Werte dieses Typs sind Strings. Mögliche Werte sind:

  • "basic": Die Benachrichtigung enthält:

    • einen Titel (NotificationOptions.title)
    • eine Nachricht (NotificationOptions.message)
    • ein Symbol (NotificationOptions.iconUrl) Optional
    • eine zusätzliche Nachricht (NotificationOptions.contextMessage) Optional
    • bis zu zwei Schaltflächen (NotificationOptions.buttons) Optional
  • "image": alles von "basic" und zusätzlich:

    • ein Bild (NotificationOptions.imageUrl)
  • "list": alles von "basic" und zusätzlich:

    • eine Liste von Elementen (NotificationOptions.items)
  • "progress": alles von "basic" und zusätzlich:

    • einen Fortschrittsindikator (NotificationOptions.progress)

Derzeit unterstützt Firefox hier nur "basic".

Browser-Kompatibilität

Hinweis: Diese API basiert auf Chromiums chrome.notifications API.