alarms.clearAll()
Cancels all active alarms.
Syntax
js
browser.alarms.clearAll()
Parameters
None.
Return value
A Promise fulfilled with undefined.
Note:
Before Firefox 157, the promise was fulfilled with a boolean: true if any alarms were cleared and false otherwise. Before Chrome 157, the promise always fulfilled with true. Safari always fulfills the promise with undefined. 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:
js
async function clearAllAlarms() {
await browser.alarms.clearAll();
console.log("All alarms cleared");
}
clearAllAlarms();
Example extensions
Browser compatibility
Note:
This API is based on Chromium's chrome.alarms API.