Chrome version is 33.0.1750.154 m.
As per the documentation at http://developer.chrome.com/extensions/alarms#method-clear, the signature of clear method is: chrome.alarms.clear(string name, function callback).
I have an alarm in my extension which is still under development:
chrome.alarms.get('refreshForNotification', function(alarm){
console.log('>>>' + JSON.stringify(alarm));
});
>>>{"name":"refreshForNotification","periodInMinutes":2,"scheduledTime":1395892890429.581}
Now, when I try to clear this alarm with:
chrome.alarms.clear('refreshForNotification', function(wasCleared){
console.log('>>> wasCleared: ' + wasCleared);
});
I am getting the below error:
Error: Invocation of form alarms.clear(string, function) doesn't match definition alarms.clear(optional string name)
message: "Invocation of form alarms.clear(string, function) doesn't match definition alarms.clear(optional string name)"
Can someone please guide/point me what is going wrong here? The alarms api is stable from chrome 22 as per documentation. If my code is not wrong, then either documentation is old or documentation is too new and current behaviour on my chrome will change in future.
Any hints/help will be useful.
Thanks