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. Chrome fulfills the promise with true and Safari with undefined. Don't rely on the fulfillment value. To check whether any alarms remain, call alarms.getAll().

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.