--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.
To post to this group, send email to android-webview-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/278b9832-e43e-4af3-8919-3f7d1df81967%40chromium.org.
Yeah that behavior looks odd, but it's intended. Visibility is calculated as:visible = !paused && (!attached to window || window visible)In other words, the window visible state is ignored if webview is detached. This is because webview does not know the window visibility state when it is detached, and there are many apps that uses a detached webview when detached, so expects a detached webview to function normally as if it's visible.Another "oddity" you didn't notice is page visibilityState has nothing to do with WebView.setVisibilityIf you want to control page visibility from your app, use WebView.onPause/onResume.
On Mon, Oct 3, 2016 at 10:17 AM, Luís Medeiros <lpmf...@gmail.com> wrote:
Hi guys!I'm trying to use Page Visibility API in a Android WebView (v. 54.0.2840.42), but I've got some problems.For example, a detached WebView always returns visibilityState = 'visible'. (It's not make sense! The WebView isn't attached to window, how could it be visible?!).And a focused WebView returns visibilityState = 'visible' even when screen is turned off.However, in some cases the WebView works. For example when the app is switched for another and it goes to background, the backgrounded WebView rightly returns visibilityState = 'hidden'.So, can anybody explain something about these wrong behaviors?Bests,
--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.
To post to this group, send email to android-w...@chromium.org.
Hi, Bo!Unfortunately these behaviors don't compliant with my expectations...I need to handle the visibility state of a WebView from the javascript code and I believed that I could it thought Page Visibility API.
Thank you anyway.
On Monday, October 3, 2016 at 2:26:00 PM UTC-3, Bo Liu wrote:
Yeah that behavior looks odd, but it's intended. Visibility is calculated as:visible = !paused && (!attached to window || window visible)In other words, the window visible state is ignored if webview is detached. This is because webview does not know the window visibility state when it is detached, and there are many apps that uses a detached webview when detached, so expects a detached webview to function normally as if it's visible.Another "oddity" you didn't notice is page visibilityState has nothing to do with WebView.setVisibilityIf you want to control page visibility from your app, use WebView.onPause/onResume.
On Mon, Oct 3, 2016 at 10:17 AM, Luís Medeiros <lpmf...@gmail.com> wrote:
Hi guys!I'm trying to use Page Visibility API in a Android WebView (v. 54.0.2840.42), but I've got some problems.For example, a detached WebView always returns visibilityState = 'visible'. (It's not make sense! The WebView isn't attached to window, how could it be visible?!).And a focused WebView returns visibilityState = 'visible' even when screen is turned off.However, in some cases the WebView works. For example when the app is switched for another and it goes to background, the backgrounded WebView rightly returns visibilityState = 'hidden'.So, can anybody explain something about these wrong behaviors?Bests,
--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsubscribe...@chromium.org.
To post to this group, send email to android-w...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/278b9832-e43e-4af3-8919-3f7d1df81967%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.
To post to this group, send email to android-webview-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/39f55718-8691-4778-b1be-4985197089c9%40chromium.org.
To post to this group, send email to android-webview-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/39f55718-8691-4778-b1be-4985197089c9%40chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.
To post to this group, send email to android-w...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/278b9832-e43e-4af3-8919-3f7d1df81967%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.
To post to this group, send email to android-w...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/39f55718-8691-4778-b1be-4985197089c9%40chromium.org.
--
Luís Medeiros
--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.
To post to this group, send email to android-w...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/CA%2BjQ1OvQ7L_tD%3DQ0rXNfvrtAja%3Dv8NLAf4P-MbpEEsJ7tp4HuQ%40mail.gmail.com.