Notification:tag 属性

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

安全上下文: 此项功能仅在一些支持的浏览器安全上下文(HTTPS)中可用。

备注: 此特性在 Web Worker 中可用。

Notification 接口的 tag 只读属性表示通知的识别标签。此属性通过 Notification() 构造函数的 tag 选项中指定。

通知的标签的构想是多个通知可以共享同一个标签,将它们链接在一起。然后可以通过编程方式将一个通知替换为另一个通知,以避免用户的屏幕被大量类似的通知填满。

一个字符串。

示例

我们的使用 Notifications API 文章有一个很好的通知的标签的使用示例。

规范

Specification
Notifications API
# dom-notification-tag

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
tag

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

参见