I've done javascript below to view notifications. It works and is called every 10 seconds. However, when two notification windows appear, only one is closed automatically. Is it possible for me to close it after a while or is it always the user who has to manually close it? Thank you.
function notify(mensagem) {
Notification.requestPermission(function() {
var notification = new Notification("Vai aparecer notificação!", {
icon: 'favicon.ico',
icon: 'logo.png',
body: mensagem
});
notification.onclick = function() {
window.open("http://www.site.com");
}
});
}