// workaround for "Bug 875114 - Web notifications should optionally be permanent, not automatically close after 4 seconds"
// (https://bugzilla.mozilla.org/show_bug.cgi?id=875114)
// solution by j-l-n (https://github.com/j-l-n)
if(typeof window.mozInnerScreenX !== "undefined"){ //Firefox
notification.onshow = function(){
var show = new Date().getTime();
notification.onclose = function(){
var close = new Date().getTime();
var dif = close - show;
console.log(dif);
if(dif > 3900 && dif < 4100){
console.log("closed by browser"); //show notification again
}
}
}
}