From 295e660461f13910009ee51edc26afca01db03eb Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Wed, 16 Jun 2021 11:45:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20`Notification=20not=20defi?= =?UTF-8?q?ned`=20in=20Duckduckgo=20browser=20(Fix=20#224=20again)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG | 1 + themes/default/public/js/lufi-notifications.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 78e3960..1bbaec7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Revision history for Lufi ?.??.? ????-??-?? - 🔧 Set default morbo port to 3000 (as it should have stay) + - 🐛 Fix `Notification not defined` in Duckduckgo browser (Fix #224 again) 0.05.13 2021-01-28 - 🐛 Fix latest git tag improperly fetched diff --git a/themes/default/public/js/lufi-notifications.js b/themes/default/public/js/lufi-notifications.js index d0cd504..52af2c2 100644 --- a/themes/default/public/js/lufi-notifications.js +++ b/themes/default/public/js/lufi-notifications.js @@ -1,5 +1,5 @@ function notify(title, body) { - if (!'Notification' in window) { + if (!'Notification' in window || typeof(Notification) === 'undefined') { console.log("This browser does not support desktop notification, cannot send following message: "+title+" "+body); return; } @@ -16,7 +16,7 @@ function notify(title, body) { } document.addEventListener('DOMContentLoaded', function () { - if (!'Notification' in window) { + if (!'Notification' in window || typeof(Notification) === 'undefined') { return; }