whatwg/notifications — pull request #1 by jakearchibald (2013-01-24 21:48:05+00:00)
Title: Optional permission callback

The callback is redundant in the following use-case:

```javascript
var userWantsChatNoficiations = false;

// This would be called when the user says
// they want notifications for chat messages
function userRequestsChatNotifications() {
// The callback is redundant in this case
Notification.requestPermission(function() {});
userWantsChatNoficiations = true;
}

// User gets a new message
function onNewChatMessage(user, msg) {
// Check if the user wants notifications & we have
// permission to show them.
if (userWantsChatNoficiations && Notification.permission == 'granted') {
new Notification("Message from " + user, {
body: msg,
tag: 'msg_' + user
}).show();
}
}
```