- var notification = webkitNotifications.createNotification(
- chrome.extension.getURL('/images/icon48.png'),
- chrome.i18n.getMessage('notificationTitle'),
- message);
- notification.show();
- setTimeout(function() {
- notification.cancel();
- }, 5000);
+ var options = {
+ type: 'basic',
+ title: chrome.i18n.getMessage('notificationTitle'),
+ message: message,
+ iconUrl: chrome.extension.getURL('/images/icon128.png'),
+ };
+
+ var id = 'clearhistory advance notify';
+ chrome.notifications.clear(id, function(wasCleared) {
+ chrome.notifications.create(id, options, function(){});
+ });