diff --git a/client/js/lounge.js b/client/js/lounge.js index 6eab611c..30186cd8 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -1031,19 +1031,24 @@ $(function() { body = msg.text.replace(/\x02|\x1D|\x1F|\x16|\x0F|\x03(?:[0-9]{1,2}(?:,[0-9]{1,2})?)?/g, "").trim(); } - var notify = new Notification(title, { - body: body, - icon: "img/logo-64.png", - tag: target - }); - notify.onclick = function() { - window.focus(); - button.click(); - this.close(); - }; - window.setTimeout(function() { - notify.close(); - }, 5 * 1000); + try { + var notify = new Notification(title, { + body: body, + icon: "img/logo-64.png", + tag: target + }); + notify.onclick = function() { + window.focus(); + button.click(); + this.close(); + }; + window.setTimeout(function() { + notify.close(); + }, 5 * 1000); + } catch (exception) { + // `new Notification(...)` is not supported and should be silenced. + } + } } }