Issue metadata
Sign in to add a comment
|
Page Visibility API not updating in cross-domain iframe
Reported by
samkjo...@gmail.com,
Jul 18
|
||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 Steps to reproduce the problem: 1. Open dev tools on any page containing a cross-domain iframe and select the document of the cross-domain iframe. 2. With dev tools in a separate window, minimize the page. The values of `document.hidden` and `document.visibilityState` will (incorrectly) be `false` and `"visible"`, respectively. 3. Now select the document of the top window in dev tools and repeat step 2. The values of `document.hidden` and `document.visibilityState` will be `true` and `"hidden"` What is the expected behavior? When the page is minimized, `document.hidden` should be `true` and `document.visibilityState` should be `"hidden"` (in any document). What went wrong? In the cross-domain iframe, `document.hidden` is `false` and `document.visibilityState` is `"visible"` Did this work before? Yes I don't know the exact version. Does this work in other browsers? Yes Chrome version: 67.0.3396.99 Channel: stable OS Version: OS X 10.13.6 Flash Version: Shockwave Flash 30.0 r0 This bug only affects Chrome 67 (as far as I know), and only affects the minimized window and lockscreen cases. It is not present in Chrome Canary, Opera, Firefox, or Safari. Even though Canary works OK, I'm still filing in case this was something that was missed.
,
Jul 18
Interesting. This repros for me on Mac Chrome 67.0.3396.99, but not on Windows or Linux Chrome 67.0.3396.99 (using http://csreis.github.io/tests/cross-site-iframe.html after clicking "Go cross-site (simple page)"). It still repros for me on Mac Canary 69.0.3495.0, so it doesn't appear fixed. Ken, do you happen to know who works on the page visibility API and who might be able to look into this? CC'ing Avi as well, since it's Mac specific.
,
Jul 18
,
Jul 18
panicker@, do you think you (or someone on your team) could investigate this?
,
Jul 26
Page visibility doesn't have an owner at the moment. I'm happy to do code reviews, but won't have time to look into this P1 issue (also out for the rest of the week btw)
,
Aug 13
This affects also the case in which a window is totally covered by another one.
,
Sep 12
We also stumbled over this issue today. We could reproduce the issue in MacOS 10.13.6 with Chrome 69.0.3497.92 (Official Build). We also tried on MacOS 10.13.6 with Chrome 68.0.3440.106 and could not reproduce the issue there. If the OP found it in Chrome 67 it seems to have been fixed in Chrome 68 but reintroduced in Chrome 69. Seems like a clear bug to us since the rfc specifies that the state should always be based on the top context and we get different document.hidden values in top context (true) and cross-site-iframe context (false) when minimizing the browser. So the info about minimizing reaches the browser since document.hidden gives true in the top context but somehow this information does not reach the cross-site-iframe. This also breaks related features like the throttling of timeouts in background.
,
Sep 21
On issue 886613 I found out that adding --disable-features=WebContentsOcclusion to the command line fixed an issue related to cross-site-iframes... I wonder if the same fix causes this to work. And that would explain why it is mac only because occulusion support is mac & chromeos only.
,
Sep 24
Thanks for the note. We tried adding --disable-features=WebContentsOcclusion but it does not fix the issue. It rather disables detecting minimized browser completely. With --disable-features=WebContentsOcclusion in minimized browser: - in top context: document.hidden == false - in cross-site-iframe context: document.hidden == false Without --disable-features=WebContentsOcclusion in minimized browser: - in top context: document.hidden == true - in cross-site-iframe context: document.hidden == false
,
Sep 25
,
Oct 15
Any updates on this? Anything we can do to narrow down the issue?
,
Dec 5
I actually think this might be related to WebContentsImpl::WasOccluded; right now we do not replicate a page message for visibility API the same way as WebContentsImpl::WasHidden. I will test this and update.
,
Dec 5
Confirming that adding: SendPageMessage(new PageMsg_WasHidden(MSG_ROUTING_NONE)); to WebContentsImpl::WasOccluded fixes the issue. This is similar to issue 903455 but not exactly the same. I can work on this if no one else is.
,
Dec 5
+danakj who's looking at page visibility recently.
,
Dec 5
Can WebContentsImpl::WasOccluded and WebContentsImpl::WasHidden share code and do the same things?
,
Dec 5
Also same for Shown. Note that WebContentsImpl::WasShown was recently reordered to fix race conditions, with sending the Page shown before the widgets.
,
Dec 6
danakj@: There is similarities between them - but I suspect there is Occluded-specific logic which we might need to preserve (looking at RenderWidgetHostViewMac/Aura::WasOccluded and Hide). |
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by tkent@chromium.org
, Jul 18