After doing something I run this code:
var notification = webkitNotifications.createNotification(
'icon.png', // icon url - can be relative
'Done!', // notification title
'Just updated your list!' // notification body text
);
notification.show();
which of course pops up a notification into the users screen.
It there anyway to time this notification so that it auto-closes in X amount of seconds?
Thanks! R
You can use
notification.cancel();
You'll be able to call
window.close()
from inside the notification's HTML page. That will close the notification.To close at a certain time, calling something like
setTimeout( function () { window.close(); }, timeInMicroseconds);
should be effective.Chrome notification will close automatically after 2000 milli sec or 2 sec.
}
ok, when i created notification remeber the id
notificationId
and settimeout clear this id