From 0e0c0fd6556d082d265456959e80ee9077fa790b Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 17 Nov 2020 17:45:02 +0530 Subject: [PATCH] guard against typeError for unsupported notification APIs --- www/common/notify.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/common/notify.js b/www/common/notify.js index a3c8cd2b8..81dee662d 100644 --- a/www/common/notify.js +++ b/www/common/notify.js @@ -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); }