notifications.TemplateType
這是一個字串,表示要建立的通知的型別。通知有四種類型:“basic”(基本)、“image”(影像)、“list”(列表)、“progress”(進度)。
此引數會作為 NotificationOptions 的 type 屬性傳遞給 notifications.create() 和 notifications.update()。
型別
此型別的值是字串。可能的值有:
-
"basic":通知包含- 一個標題 (
NotificationOptions.title) - 一條訊息 (
NotificationOptions.message) - 一個圖示 (
NotificationOptions.iconUrl) 可選 - 一條附加訊息 (
NotificationOptions.contextMessage) 可選 - 最多兩個按鈕 (
NotificationOptions.buttons) 可選
- 一個標題 (
-
"image":包含"basic"的所有內容,另外還有- 一張圖片 (
NotificationOptions.imageUrl)
- 一張圖片 (
-
"list":包含"basic"的所有內容,另外還有- 一個專案列表 (
NotificationOptions.items)
- 一個專案列表 (
-
"progress":包含"basic"的所有內容,另外還有- 一個進度指示器 (
NotificationOptions.progress)
- 一個進度指示器 (
目前 Firefox 在此處僅支援“basic”。
瀏覽器相容性
載入中…
注意: 此 API 基於 Chromium 的 chrome.notifications API。