|
|
@ -15,6 +15,7 @@ |
|
|
|
* |
|
|
|
* |
|
|
|
* Author: Tsvetan Tsvetkov (tsekach@gmail.com) |
|
|
|
* Author: Tsvetan Tsvetkov (tsekach@gmail.com) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
//https://raw.githubusercontent.com/ttsvetko/HTML5-Desktop-Notifications/b5bc3b27fc042630d16ed55bae378a73d94d02ab/desktop-notify.js
|
|
|
|
(function (win) { |
|
|
|
(function (win) { |
|
|
|
/* |
|
|
|
/* |
|
|
|
Safari native methods required for Notifications do NOT run in strict mode. |
|
|
|
Safari native methods required for Notifications do NOT run in strict mode. |
|
|
@ -104,6 +105,9 @@ |
|
|
|
if (notification.close) { |
|
|
|
if (notification.close) { |
|
|
|
//http://code.google.com/p/ff-html5notifications/issues/detail?id=58
|
|
|
|
//http://code.google.com/p/ff-html5notifications/issues/detail?id=58
|
|
|
|
notification.close(); |
|
|
|
notification.close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (notification.cancel) { |
|
|
|
|
|
|
|
notification.cancel(); |
|
|
|
} else if (win.external && win.external.msIsSiteMode()) { |
|
|
|
} else if (win.external && win.external.msIsSiteMode()) { |
|
|
|
if (notification.ieVerification === ieVerification) { |
|
|
|
if (notification.ieVerification === ieVerification) { |
|
|
|
win.external.msSiteModeClearIconOverlay(); |
|
|
|
win.external.msSiteModeClearIconOverlay(); |
|
|
@ -139,12 +143,12 @@ |
|
|
|
} else if (win.webkitNotifications && win.webkitNotifications.checkPermission) { |
|
|
|
} else if (win.webkitNotifications && win.webkitNotifications.checkPermission) { |
|
|
|
//Chrome & Firefox with html5-notifications plugin installed
|
|
|
|
//Chrome & Firefox with html5-notifications plugin installed
|
|
|
|
permission = PERMISSION[win.webkitNotifications.checkPermission()]; |
|
|
|
permission = PERMISSION[win.webkitNotifications.checkPermission()]; |
|
|
|
} else if (navigator.mozNotification) { |
|
|
|
|
|
|
|
//Firefox Mobile
|
|
|
|
|
|
|
|
permission = PERMISSION_GRANTED; |
|
|
|
|
|
|
|
} else if (win.Notification && win.Notification.permission) { |
|
|
|
} else if (win.Notification && win.Notification.permission) { |
|
|
|
// Firefox 23+
|
|
|
|
// Firefox 23+
|
|
|
|
permission = win.Notification.permission; |
|
|
|
permission = win.Notification.permission; |
|
|
|
|
|
|
|
} else if (navigator.mozNotification) { |
|
|
|
|
|
|
|
//Firefox Mobile
|
|
|
|
|
|
|
|
permission = PERMISSION_GRANTED; |
|
|
|
} else if (win.external && (win.external.msIsSiteMode() !== undefined)) { /* keep last */ |
|
|
|
} else if (win.external && (win.external.msIsSiteMode() !== undefined)) { /* keep last */ |
|
|
|
//IE9+
|
|
|
|
//IE9+
|
|
|
|
permission = win.external.msIsSiteMode() ? PERMISSION_GRANTED : PERMISSION_DEFAULT; |
|
|
|
permission = win.external.msIsSiteMode() ? PERMISSION_GRANTED : PERMISSION_DEFAULT; |
|
|
|