Cancels an alarm, given its name.
Syntax
browser.alarms.clear( name, // string function(wasCleared) {...} // function )
Parameters
name
Optional
. The name of the alarm to clear. If you don't supply this, the empty string "" will be used.string
callback
Optionalfunction
. The function is passed the following arguments:-
wasCleared
boolean
.true
if the alarm was cleared,false
otherwise.
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.