New issue
Advanced search Search tips

Issue 715130 link

Starred by 18 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug

Blocked on:
issue 668690


Participants' hotlists:
Lifecycle


Sign in to add a comment

Page Visibility API doesn't fire event for Windows and Linux when alt+tab to a different window

Reported by ma...@worldofcardgames.com, Apr 25 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Steps to reproduce the problem:
1. Open attached pagevis.html in a browser window
2. Open a new tab in Chrome
3. Switch bewtween pagevis.html and your empty tab - you will see a successful message being printed which shows the visibility changing from hidden to visible.
4. Open a completely new window such as Firefox or any other application, so that Chrome is obscured.
5. Switch the focus back to Chrome so that it is now maximized.
6. You will see no change - the Page Visibility API did not fire an event.

What is the expected behavior?
Page Visibility API is expected to fire an event when switching between windows, not just between tabs in the browser.

What went wrong?
No event was fired.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 57.0.2987.133 (64-bit)  Channel: stable
OS Version: Ubuntu 14.04
Flash Version:
 
pagevis.html
386 bytes View Download
There's a stackoverflow description of this issue: http://stackoverflow.com/questions/28993157/visibilitychange-event-is-not-triggered-when-switching-program-window-with-altt

It points to a discussion of the problem on this site, along with a workaround, but it is non-ideal and I believe the browser should handle using alt-tab using the API directly: https://stereologics.wordpress.com/2015/04/02/about-page-visibility-api-hidden-visibilitychange-visibilitystate/

Comment 2 Deleted

 Issue 293128  may have been related. It is fixed, but it appears to me that the fix did not address the problem that still occurs when the browser is obscured by another window

Comment 4 by rbyers@chromium.org, Apr 27 2017

Blockedon: 246844
Cc: ccameron@chromium.org
Components: Blink>PerformanceAPIs
The root of the issue seems to be that Windows simply does not provide a straight way to know if a window is currently covered by another window or not. I found this workaround published on the MSDN forum, which might be of inspiration for a fix in Chromium: https://social.msdn.microsoft.com/Forums/vstudio/en-US/78289886-f3c1-405b-aaa1-722a23690245/how-to-check-if-a-window-is-partially-or-completely-obscured-by-other-windows?forum=netfxbcl
Cc: pnangunoori@chromium.org
Labels: M-61
Status: Untriaged (was: Unconfirmed)
Tested on Chrome Stable #59.0.3071.115 on Ubuntu 14.04, Mac 10.12.5 and Windows 10 and able to reproduce the issue. Issue is also reproduced on the latest Canary version #61.0.3163.0.

This is a non-regression issue and able to reproduce from M-45 #45.0.2454.85. Marking it as untriaged so that issue gets addressed.

Note - For Linux, verified on 47.0.2499.0.

Thanks.
Blockedon: -246844
Cc: altimin@chromium.org skyos...@chromium.org
Labels: -Pri-2 Pri-3
Sami or Alexander - do we have a bug open tracking throttling tabs in occluded windows?

That seems higher priority than this, and requires the same plumbing.
Status: Available (was: Untriaged)
PageVisibility is currently implemented using the visible / hidden signal from browser which doesn't consider occlusion.
The occlusion signal would have to be plumbed through from the browser process (tab manager?) to renderer
Instrumentation might look like this:
https://chromium-review.googlesource.com/c/557910


Owner: panicker@chromium.org
Status: Assigned (was: Available)
Cc: fdoray@chromium.org
I believe +fdoray@ has a prerequisite patch in the works for this (albeit not for Linux).
Cc: panicker@chromium.org
Components: -Blink>PerformanceAPIs Blink>PageLifecycle
Owner: ----
Status: Available (was: Assigned)
Blockedon: 668690
This will be addressed by my current work on tab occlusion.

Sign in to add a comment