--- title: Notification.badge slug: Web/API/notification/badge tags: - Notification - Notification badge - Notifications API - Web API translation_of: Web/API/Notification/badge ---

{{SeeCompatTable}}{{APIRef("Notifications API")}}

当没有足够的空间来显示通知本身时,{{domxref("Notification")}}接口的 badge 属性返回用于表示通知的图像URL。

语法

var url = Notification.badge

包含一个URL的 {{domxref('USVString')}} 。

规范

规范 状态 说明
{{SpecName('Web Notifications','#dom-notification-badge','badge')}} {{Spec2('Web Notifications')}} Initial definition.

浏览器兼容性

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatChrome(53.0)}} {{CompatUnknown}} {{CompatUnknown}} {{CompatOpera(39)}} {{CompatUnknown}}
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support {{CompatNo}} {{CompatChrome(53.0)}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatOperaMobile(39)}} {{CompatUnknown}} {{CompatChrome(53.0)}}