New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 10 users
Status: Fixed
Owner: ----
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment
Visibility state is not updated when minimising, obscuring or switching workspaces on Linux
Reported by andyearn...@gmail.com, Sep 17 2013 Back to list
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1626.0 Safari/537.36

Steps to reproduce the problem:
1. Visit http://jsfiddle.net/abNUu/
2. Confirm that cycling to another tab and back again will log "hidden", followed by "visible" to the console.
3. With the tab active again, minimise the browser and maximise again.  Confirm that neither action caused a new state to be logged to the console.

What is the expected behavior?
The Page Visibility API specification[1] gives the following as examples that may cause the visibility state to be 'hidden':

 - The User Agent is minimized.
 - The User Agent is not minimized, but the page is on a background tab.
 - The User Agent is about to unload the page.
 - The User Agent is about to traverse to a session history entry.
 - The Operating System lock screen is shown.

Also, for the document.hidden property:

"On getting, the hidden attribute MUST return true if the Document contained by the top level browsing context (root window in the browser's viewport) [HTML5] is not visible at all. The attribute MUST return false if the Document contained by the top level browsing context is at least partially visible on at least one screen."

What went wrong?
As far as I can tell, Chromium on Linux (unsure about other operating systems) only updates the state when the tab is changed and not for any other reason.  Likewise, getting the document.webkitHidden property returns "true" only when the tab is not active in the browser window, but "false" when the browser window is minimised, on another workspace, obscurred by another window, etc.

Did this work before? N/A 

Chrome version: 31.0.1626.0  Channel: dev
OS Version: Ubuntu 13.04
Flash Version: Shockwave Flash 11.8 r800

[1]: http://www.w3.org/TR/page-visibility/
 
Comment 1 by bro...@gmail.com, Dec 11 2013
This is also an issue on MacOSX (testing in Chrome 31.0.1650.63)

Firefox appears to suffer from a similar issue: https://bugzilla.mozilla.org/show_bug.cgi?id=777825
Cc: msrchandra@chromium.org
Labels: -OS-Linux OS-All M-33
Status: Untriaged
Able to reproduce the issue. This is a Non-Regression Issue. Existing from M27 builds.
Note: The same behavior is seen in FF and IE also.
Project Member Comment 3 by bugdroid1@chromium.org, Dec 17 2013
Labels: -M-33 MovedFrom-33 M-34
Moving all non essential bugs to the next Milestone.
Comment 4 by dxie@chromium.org, Mar 3 2014
Labels: -M-34 MovedFrom-34
This issue has already been moved once and is lower than Priority 1,therefore removing mstone.
This issue is still reproducable in Chrome. Firefox is working just fine. Couldn't confirm for IE.
Still a problem and reproducible on Mac OS X's Chromium too.  An additional case where the page should be considered hidden is if Chromium is set to full screen and then swiped away in Mac OS X Mountain Lion and Yosemite.
Comment 7 by Deleted ...@, Jan 25 2015
I would like to add that on Windows 8.1, both locking the machine (Win-L) and switching window focus (Alt-Tab) do not trigger this event, whereas I'd expect them to. 

Minimizing the window does fire the event as expected however. 

I'm running Chrome version 40.0.2214.91 m.
Comment 8 by joone....@intel.com, Feb 20 2015
Here is a patch: https://codereview.chromium.org/944763002/
It only works for Ubuntu Unity so I'm trying to support GNOME3 and other Linux desktops.
Somewhere between Chrome 40 and Chrome 42, this appears to have been fixed for Mac OS X, and surprisingly all bases are now covered, even when the window is obscured by another window.  

Can someone on the thread verify that this is still broken on Linux?
Comment 10 by abl...@gmail.com, Apr 9 2015
Chrome: 41.0.2272.118 (Official Build) 
Ubuntu 14.04
fvwm 2.6.5

Minimize/restore: works
Switching tab: works
Switching workspaces: does not work
Covering with opaque window: does not work
Switching to a different VT: does not work
starting xscreensaver: does not work
Comment 11 by ayla...@gmail.com, Apr 10 2015
Version 41.0.2272.118 (64-bit) Mac OS X - minimize doesn't work.
#11, it must have been fixed in 42 then. 
CrOS also has the same issue: https://code.google.com/p/chromium/issues/detail?id=502379
Status: Fixed
Now it works both on Linux and OS X. Closing.
Sign in to add a comment