Skip to content

Instantly share code, notes, and snippets.

@fukata
Created June 14, 2011 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fukata/1025413 to your computer and use it in GitHub Desktop.
Save fukata/1025413 to your computer and use it in GitHub Desktop.
Automatic close Google Chrome Desktop Notification
var notification = webkitNotifications.createNotification(
'icon-48.png',
'TITLE',
'BODY'
);
notification.ondisplay = function(){
var self = this;
var close_interval = 5000;
setTimeout(function(){
self.cancel();
}, close_interval);
};
notification.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment