Fix: Notification check for IE
This commit is contained in:
@@ -82,18 +82,31 @@
|
||||
var timeOutEventID;
|
||||
|
||||
function ShowNotifyTimeOver(timeLeft) {
|
||||
if(Notification) { // except IE
|
||||
Notification.requestPermission(function (result) {
|
||||
Notification.permission = result;
|
||||
var isNotificationIsSupported = !!(window.Notification /* W3C Specification */ || win.webkitNotifications /* old WebKit Browsers */ || navigator.mozNotification /* Firefox for Android and Firefox OS */)
|
||||
|
||||
console.log(result);
|
||||
if(result !== "denied")
|
||||
if(isNotificationIsSupported) {
|
||||
if(Notification) { // prepared browser for using Notification
|
||||
if(Notification.permission === "granted") {
|
||||
AddNotifyEventByNotification(timeLeft);
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
Notification.requestPermission(function (result) {
|
||||
Notification.permission = result;
|
||||
|
||||
if(result === "granted") {
|
||||
AddNotifyEventByNotification(timeLeft);
|
||||
return;
|
||||
}
|
||||
|
||||
AddNotifyEventByAlert(timeLeft);
|
||||
});
|
||||
} else { // IE
|
||||
console.log("no notification");
|
||||
});
|
||||
} else { // not prepared browser for using Notification
|
||||
console.log("no notification - !Notification");
|
||||
AddNotifyEventByAlert(timeLeft);
|
||||
}
|
||||
} else { // not prepared browser for using Notification - IE
|
||||
console.log("no notification - Notification in window");
|
||||
AddNotifyEventByAlert(timeLeft);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user