browser: fix value of document.hidden
This commit is contained in:
parent
c68e38f480
commit
ff51e4033a
1 changed files with 8 additions and 2 deletions
|
@ -118,6 +118,12 @@ Object.defineProperty window.history, 'length',
|
||||||
get: ->
|
get: ->
|
||||||
getHistoryOperation 'length'
|
getHistoryOperation 'length'
|
||||||
|
|
||||||
# Make document.hidden return the correct value.
|
# Make document.hidden and document.visibilityState return the correct value.
|
||||||
Object.defineProperty document, 'hidden',
|
Object.defineProperty document, 'hidden',
|
||||||
get: -> !remote.getCurrentWindow().isVisible()
|
get: ->
|
||||||
|
currentWindow = remote.getCurrentWindow()
|
||||||
|
!currentWindow.isFocused() || !currentWindow.isVisible()
|
||||||
|
|
||||||
|
Object.defineProperty document, 'visibilityState',
|
||||||
|
get: ->
|
||||||
|
if document.hidden then "hidden" else "visible"
|
||||||
|
|
Loading…
Reference in a new issue