I'am trying to develop a desktop notification JS in my customer application. The code works fine on firefox but not on Chrome. I'm changing the notification permission to allow on settings -> Advanced -> Content Settings -> Notifications -> Allow/Deny but still not working.
this is my code :
notifyMe: function() {
if (!("Notification" in window)) {
alert("Ce navigateur ne supporte pas les notifications desktop");
} else if (Notification.permission !== 'denied') {
Notification.requestPermission(function(permission) {
if (!('permission' in Notification)) {
Notification.permission = permission;
}
if (permission === "granted") {
var notification = new Notification("Notify ")
}
});
}
}
Can somebody help me ? Thanks.