alarms.clearAll()
取消所有活跃的闹钟。
这是一个返回 Promise
的异步函数。
语法
js
let clearAlarms = browser.alarms.clearAll()
参数
无。
返回值
一个 Promise
,其会兑现一个布尔值。如果有任何闹钟被清除,将为 true
,否则为 false
。注意,Chrome 总是传递 true
。
示例
js
function onClearedAll(wasCleared) {
console.log(wasCleared); // true/false
}
let clearAlarms = browser.alarms.clearAll();
clearAlarms.then(onClearedAll);
示例扩展
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
clearAll |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
备注:
此 API 基于 Chromium 的 chrome.alarms
API。