MDN self-hosted library · e01.org

alarms.clearAll()

Cancels all active alarms.

Open notebook · 1 cells webextension-api-function upstream source

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: 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:

async function clearAllAlarms() {
  await browser.alarms.clearAll();
  console.log("All alarms cleared");
}

clearAllAlarms();

Browser compatibility

[!NOTE] This API is based on Chromium's chrome.alarms API.