diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 257be4440..f9232c8a6 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -131,19 +131,17 @@ Unread = openNotification: (post) -> return unless Header.areNotificationsEnabled - # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1130502 (SeaMonkey) - try - notif = new Notification "#{post.info.nameBlock} replied to you", - body: post.info.commentDisplay - icon: Favicon.logo - notif.onclick = -> - Header.scrollToIfNeeded post.nodes.root, true - # XXX https://github.com/derjanb/tampermonkey/issues/253 - $.global -> window.focus() - notif.onshow = -> - setTimeout -> - notif.close() - , 7 * $.SECOND + notif = new Notification "#{post.info.nameBlock} replied to you", + body: post.info.commentDisplay + icon: Favicon.logo + notif.onclick = -> + Header.scrollToIfNeeded post.nodes.root, true + # XXX https://github.com/derjanb/tampermonkey/issues/253 + $.global -> window.focus() + notif.onshow = -> + setTimeout -> + notif.close() + , 7 * $.SECOND onUpdate: (e) -> if !e.detail[404] diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index a7511b526..f52f78877 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -206,22 +206,20 @@ QR = unless Header.areNotificationsEnabled alert el.textContent if d.hidden and not QR.cooldown.auto else if d.hidden or not (focusOverride or d.hasFocus()) - # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1130502 (SeaMonkey) - try - notif = new Notification el.textContent, - body: el.textContent - icon: Favicon.logo - # XXX https://github.com/derjanb/tampermonkey/issues/253 - notif.onclick = -> $.global -> window.focus() - if $.engine isnt 'gecko' - # Firefox automatically closes notifications - # so we can't control the onclose properly. - notif.onclose = -> notice.close() - notif.onshow = -> - setTimeout -> - notif.onclose = null - notif.close() - , 7 * $.SECOND + notif = new Notification el.textContent, + body: el.textContent + icon: Favicon.logo + # XXX https://github.com/derjanb/tampermonkey/issues/253 + notif.onclick = -> $.global -> window.focus() + if $.engine isnt 'gecko' + # Firefox automatically closes notifications + # so we can't control the onclose properly. + notif.onclose = -> notice.close() + notif.onshow = -> + setTimeout -> + notif.onclose = null + notif.close() + , 7 * $.SECOND notifications: []