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 passestrue
here.
Browser compatibility
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.