Reputation: 460
Had a look around an can only really find resources on creating notifications, and not updating them. Heard it might be possible if I used chrome.notifications instead but again can't find anyway to do it.
This currently is my code, and it ends up just closing any previous notification then reissuing it.
if (window.webkitNotifications){
if(window.webkitNotifications.checkPermission() > 0){
}
else if (seconds == 0)
{
var thumb = 'images/icon.png';
var title = 'Current Task';
var body = "Active " + hours + " hours and " + minutes + " minutes";
if (popup != "") {
popup.cancel();
}
popup = window.webkitNotifications.createNotification(thumb, title, body);
popup.show();
}
}
Anyone know if it's possible to update a notification instead of just recreate it? Would make it much more user friendly, and for a live feed of information more of a float over any other job they might be doing?
Upvotes: 0
Views: 233
Reputation: 5096
Once the notification has been created, the way to communicate with it is through message passing. Read up on it here: http://developer.chrome.com/extensions/messaging.html
Timeline:
Upvotes: 2