]> khamidou — GitHub mirrors - electron.git/commitdiff
Override document.hidden
authorCheng Zhao <zcbenz@gmail.com>
Thu, 1 Oct 2015 10:39:35 +0000 (18:39 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 1 Oct 2015 10:39:35 +0000 (18:39 +0800)
atom/renderer/lib/override.coffee

index 5cffdd486d9ca2f0c5e3d73725e570286b963870..93cf8b8357e8a7fc018e977682bf956e8566a2ef 100644 (file)
@@ -122,3 +122,7 @@ window.history.go = (offset) -> sendHistoryOperation 'goToOffset', offset
 Object.defineProperty window.history, 'length',
   get: ->
     getHistoryOperation 'length'
+
+# Make document.hidden return the correct value.
+Object.defineProperty document, 'hidden',
+  get: -> !remote.getCurrentWindow().isVisible()