Remove workaround for SeaMonkey < 2.35 Notification crash. #904

This commit is contained in:
ccd0 2016-05-17 03:17:54 -07:00
parent f2f6f1be6c
commit 386ebfbbb7
2 changed files with 25 additions and 29 deletions

View File

@ -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]

View File

@ -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: []