mirror of
https://github.com/electron/electron.git
synced 2026-01-25 23:38:18 -05:00
browser: fix value of document.hidden
This commit is contained in:
@@ -118,6 +118,12 @@ Object.defineProperty window.history, 'length',
|
||||
get: ->
|
||||
getHistoryOperation 'length'
|
||||
|
||||
# Make document.hidden return the correct value.
|
||||
# Make document.hidden and document.visibilityState return the correct value.
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user