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”。
浏览器兼容性
Loading…
备注:
此 API 基于 Chromium 的 chrome.notifications API。