The Notification API specifications support 2 events that can be fired by a Notification.
click
event.This event will run when you click on the notification body (excluding the closing X and the Notifications configuration button).
Example:
notification.onclick = function(event) {
console.debug("you click me and this is my event object: ", event);
}
error
eventThe notification will fire this event whenever something wrong will happen, like being unable to display
notification.onerror = function(event) {
console.debug("There was an error: ", event);
}