alarms.clearAll()
Cancels all active alarms.
Cancels all active alarms.
Syntax
browser.alarms.clearAll()
Parameters
None.
Return value
A Promise fulfilled with undefined.
[!NOTE] Before Firefox 157, the promise was fulfilled with a boolean:
trueif any alarms were cleared andfalseotherwise. Before Chrome 157, the promise always fulfilled withtrue. Safari always fulfills the promise withundefined. Don't rely on the fulfillment value. See w3c/webextensions#1055 for details.
Examples
Clear all the alarms the extension has scheduled, then log that the alarms are cleared:
async function clearAllAlarms() {
await browser.alarms.clearAll();
console.log("All alarms cleared");
}
clearAllAlarms();
Browser compatibility
[!NOTE] This API is based on Chromium's
chrome.alarmsAPI.