Work around Tampermonkey winow.focus bug. #656
This commit is contained in:
parent
1aa10ba631
commit
6e322ac838
@ -136,7 +136,8 @@ Unread =
|
|||||||
icon: Favicon.logo
|
icon: Favicon.logo
|
||||||
notif.onclick = ->
|
notif.onclick = ->
|
||||||
Header.scrollToIfNeeded post.nodes.root, true
|
Header.scrollToIfNeeded post.nodes.root, true
|
||||||
window.focus()
|
# XXX https://github.com/derjanb/tampermonkey/issues/253
|
||||||
|
$.global -> window.focus()
|
||||||
notif.onshow = ->
|
notif.onshow = ->
|
||||||
setTimeout ->
|
setTimeout ->
|
||||||
notif.close()
|
notif.close()
|
||||||
|
|||||||
@ -215,7 +215,8 @@ QR =
|
|||||||
notif = new Notification el.textContent,
|
notif = new Notification el.textContent,
|
||||||
body: el.textContent
|
body: el.textContent
|
||||||
icon: Favicon.logo
|
icon: Favicon.logo
|
||||||
notif.onclick = -> window.focus()
|
# XXX https://github.com/derjanb/tampermonkey/issues/253
|
||||||
|
notif.onclick = -> $.global -> window.focus()
|
||||||
if $.engine isnt 'gecko'
|
if $.engine isnt 'gecko'
|
||||||
# Firefox automatically closes notifications
|
# Firefox automatically closes notifications
|
||||||
# so we can't control the onclose properly.
|
# so we can't control the onclose properly.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user