Clears a notification, given its ID.
Syntax
browser.notifications.clear( id, // string function(wasCleared) {...} // optional function )
Parameters
id
string
. The ID of the notification to clear. This is the same as the ID passed intonotifications.create()
's callback.callback
Optionalfunction
. The function is passed the following arguments:-
wasCleared
boolean
.true
if the notification was cleared, orfalse
if it was not (for example, because the notification referenced byid
did not exist).
Browser compatibility
Examples
Acknowledgements
This API is based on Chromium's chrome.notifications
API.