I have a page that notifies the user about server updates, using window.webkitNotifications.
It's not a Google Chrome extension.
I want to close all page notifications before the page unload. I'm trying to do it with:
var notifications = new Array();
// ...
var popup = window.webkitNotifications.createNotification(...);
// ...
notifications.push(popup);
// ...
function closeAll(){
for (notification in notifications) {
notifications[notification].cancel();
}
}
//...
$(window).unload(function() {
closeAll();
});
But the notifications are not closed when I reloads the page. I found this issue on Chromium project: https://code.google.com/p/chromium/issues/detail?id=40262
How can I ensure that page notifications are closed without use the Window#onunload ?
I wonder if you can add some javascript to the notification popup and settimeout withing the actual popup, that way it will close eventually.
I will have to try and test this out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With