guard against typeError for unsupported notification APIs

pull/1/head
ansuz 4 years ago
parent 0f883adafb
commit 0e0c0fd655

@ -16,6 +16,8 @@ define(['/api/config'], function (ApiConfig) {
var getPermission = Module.getPermission = function (f) {
f = f || function () {};
// "Notification.requestPermission is not a function" on Firefox 68.11.0esr
if (!Notification || typeof(Notification.requestPermission) !== 'function') { return void f(false); }
Notification.requestPermission(function (permission) {
if (permission === "granted") { f(true); }
else { f(false); }

Loading…
Cancel
Save