Extend semantics of Page Visibility API to reflect webview and app status |
|||||||
Issue descriptionSteps to reproduce the problem: 1. open an app with a webview 2. scroll the webview offscreen 3. verify that document.visibilityState = visible What is the expected behavior? If the app is not visible or the web view has no pixels visible then document.visibilityState should be 'hidden'. What went wrong? Documents do not return consistent results for Page Visibility API when run in a webview. We propose the following behavior: * When the webview has at least one pixel visible and the app is visible, then document.visibilityState = “visible” * When the app is not visible or the webview has no pixels visible, then document.visibilityState = “hidden” Did this work before? No Does this work in other browsers? N/A Chrome version: 58.0.3029.110 Channel: stable OS Version: Flash Version:
,
May 25 2017
+danyao, ajuma who can assess priority for fixing in WebKit. Does this work in Safari? I don't see why "N/A" is the appropriate answer to that question. Please check and report back here, thanks! Can you provide a specific url or reduced test case? "an app with a webview" is not enough information to be able to diagnose the problem.
,
May 25 2017
,
May 25 2017
,
May 25 2017
,
Jul 14 2017
,
Sep 28 2017
I'm not very clear on what you mean by "scroll the webview offscreen" because the entire document is the web view. If you mean that a document is loaded in in an iframe, and when that iframe is scrolled off screen, that document.visibilityState evaluated inside the iframe should return "hidden", then the Page Visibility API is not designed for this purpose. A document is considered hidden if any of the following is true: - user navigates away from it - user switches to another tab in the same window - the window is minimized - the window loses focus and is completely obstructed by another window And the visibility state of an iframe is the same as its parent document. See spec here: https://www.w3.org/TR/page-visibility/#sec-processing-model, or the more user-friendly explainer on MDN: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API Bling's behavior matches that of Safari for Page Visibility API. Intersection Observer API is closer to the behavior you're looking for. See spec here: https://w3c.github.io/IntersectionObserver/ and the MDN explainer here: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API I'll close this bug for now. Please reopen if I misunderstood your request. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by jochen@chromium.org
, May 25 2017Components: -Blink>JavaScript Blink