alarms.clearAll()

Cancels all active alarms.

Syntax

browser.alarms.clearAll(
  function(wasCleared) {...}   // function
)

Parameters

callback
function. The function is passed the following arguments:
wasCleared
boolean. true if any alarms were cleared, false otherwise. Note that Chrome always passes true here.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?45.0Yes33
Firefox
Basic support48.0

Examples

Callback-based version:

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

chrome.alarms.clearAll(onClearedAll);

Promise-based version:

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

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

Example add-ons

Acknowledgements

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

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,