Skip to content

Instantly share code, notes, and snippets.

@michaelmior
Created March 21, 2012 22:56
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 michaelmior/2153949 to your computer and use it in GitHub Desktop.
Save michaelmior/2153949 to your computer and use it in GitHub Desktop.
TalkerApp notifications for webkit
javascript:(function(){window.notifications={notifications_support:function(){return%20true;},notify:function(obj){if(obj.title%20!=window.notifications.prevmsg.title%20%26%26%20obj.description%20!=window.notifications.prevmsg.description){var%20not=window.webkitNotifications.createNotification('http://talkerapp.com/images/favicon.png',obj.title,obj.description);not.show();window.setTimeout(function(){not.cancel();},5000);}window.notifications.prevmsg=obj;},prevmsg:{}};})();
window.notifications = {
notifications_support: function () {
return true;
},
notify: function (obj) {
if (obj.title != window.notifications.prevmsg.title && obj.description != window.notifications.prevmsg.description) {
var not = window.webkitNotifications.createNotification('http://talkerapp.com/images/favicon.png', obj.title, obj.description);
not.show();
window.setTimeout(function () {
not.cancel();
}, 5000);
}
window.notifications.prevmsg = obj;
},
prevmsg: {}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment