alarms.clearAll()

Cancels all active alarms.

This is an asynchronous function that returns a Promise.

Syntax

js
let clearAlarms = browser.alarms.clearAll()

Parameters

None.

Return value

A Promise fulfilled with a boolean. This is true if any alarms were cleared, false otherwise.

Note: Chrome always passes true and Safari undefined. The return type is subject to change and may always return undefined for all browsers in the future. It is best to not rely on the return type.

Examples

js
function onClearedAll(wasCleared) {
  console.log(wasCleared); // true/false
}

let clearAlarms = browser.alarms.clearAll();
clearAlarms.then(onClearedAll);

Example extensions

Browser compatibility

Note: This API is based on Chromium's chrome.alarms API.