WorkerNavigator:clearAppBadge() 方法
WorkerNavigator 接口的 clearAppBadge() 方法通过将当前应用程序图标设置为 nothing 来清除当前应用程序图标上的徽章。nothing 表示当前没有设置徽章,并且徽章的状态为已清除。
语法
js
clearAppBadge()
参数
无。
返回值
异常
InvalidStateErrorDOMException-
如果文档未完全激活,则抛出该异常。
SecurityErrorDOMException-
如果调用被同源策略阻止,则抛出该异常。
NotAllowedErrorDOMException-
如果
PermissionStatus.state不是granted,则抛出该异常。
示例
读取应用程序中的所有消息后,调用 clearAppBadge() 方法以清除徽章并删除通知。
js
navigator.clearAppBadge();
规范
This feature does not appear to be defined in any specification.>浏览器兼容性
Loading…