New issue
Advanced search Search tips

Issue 676288 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Even when webview.onPause() and webView.pauseTimers() is called, webview keeps on refreshing

Reported by sanketga...@gmail.com, Dec 21 2016

Issue description

Steps to reproduce the problem:
1. Load a page with following HTML:
<html>
 <head>
  <meta http-equiv="refresh" content="5">
 </head>
 <body>
    Watch the page reload itself in 5 seconds!
 </body>
</html>
2. Call webview.onPause() and webview.pauseTimers()

What is the expected behavior?
The page doesn't refresh

What went wrong?
The webview keeps on refreshing even after both onPause() and pauseTimers() have been called on the webview

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 55.0.2883.91  Channel: stable
OS Version: 7.0
Flash Version: Shockwave Flash 24.0 r0
 
Components: -Blink>BackgroundSync Mobile>WebView

Comment 2 by boliu@chromium.org, Dec 21 2016

Labels: Needs-Feedback
pauseTimers only affects js, and this has nothing to do with js, so that's expected

It's debatable whether onPause should do this though. There are more uses for http-equiv="refresh" other than periodically refreshing the page, and breaking those use cases would probably be bad.

What's your use case in your app? Why not just load a different page?
I agree it has nothing to do with JS but I couldn't find any other API to stop the background data

Use case is that when application goes to background it should not consume data. Is there any other API I can use which can help me with this?

Comment 4 by boliu@chromium.org, Dec 21 2016

Status: WontFix (was: Unconfirmed)
Are you in control of the page being loaded here? You can always load about:blank or destroy the webview when going into the background.

Webview in general does not have any API to control data. There are lots of other ways for the webview to keep consuming in the background, depending on what the page is doing. At this point, it's impossible to even keep track of this at the app level, let alone controlling all the edge cases.

Android N has a os-wide data saver feature. I'm not sure what it does precisely, but that's probably the way to go for these things.
We are not control of the page being loaded here. Loading about:blank or destroying the webview will not let it resume when the application comes to the foreground.

Comment 6 by boliu@chromium.org, Dec 21 2016

Then you are out of luck. There is no "pause data" feature. Sorry.
Thanks for the quick reply :)

Sign in to add a comment