Cancels an alarm, given its name.
Syntax
browser.alarms.clear(
name, // string
function(wasCleared) {...} // function
)
Parameters
nameOptional. The name of the alarm to clear. If you don't supply this, the empty string "" will be used.stringcallbackOptionalfunction. The function is passed the following arguments:-
wasClearedboolean.trueif the alarm was cleared,falseotherwise.
Browser compatibility
Examples
function onCleared(wasCleared) {
console.log(wasCleared); // true/false
}
chrome.alarms.clear("my-periodic-alarm", onCleared);
Acknowledgements
This API is based on Chromium's chrome.alarms API.