New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 888100 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 22
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

window.history.state is null when user selects WebAPK from recents after Chrome is killed

Project Member Reported by pkotw...@chromium.org, Sep 21

Issue description

Repro steps:
1) Launch WebAPK which uses window.history.pushState()
2) Kill Chrome via "adb shell kill -9 chrome_process_id"
3) Relaunch WebAPK via Android Recents
4) log window.history.state via chrome://inspect

Expected:
window.history.state is not null
Actual:
window.history.state is null



 
Status: Started (was: Untriaged)
This bug seems to be WebappActivity specific. I can repro with a WebAPK but not with a tabbed Chrome.
Cc: pkotw...@chromium.org
Components: Mobile>WebAPKs
Owner: sbirch@chromium.org
Assigning to Sam to determine the 100% correct behavior

This bug is caused because we call Tab#reloadIgnoringCache() in WebappActivity#initializeUI()
The current behavior is intentional as per  Issue 307333 

This behavior is causing an issue for Maps See http://b/112318797
Cc: mgiuca@chromium.org sbirch@chromium.org
Owner: pkotw...@chromium.org
Status: Assigned (was: Started)
+mgiuca for spec - the current behavoiur could potentially be afoul of navigation/loading specs.  It's noteworthy that regular tabbed browsing mode doesn't do this but it does offer a refresh button in settings. 

Actually, looking at history, this was done in Chrome 33. Pull-to-refresh landed in M41: crbug/442505 
It may not be the most discoverable UI affordance, but I think the original motivation isn't valid anymore and we should revert it. Web authors have ways to control this via caching headers if they get fancy and current behaviour also prevents sophisticated websites from being able to do more advanced things, especially given that WebApks implies SW so developers are thinking about offline/reloading.
Cc: foolip@chromium.org
I'm not familiar with the navigation / loading / SW side of the spec. foolip@ may be the right person?
Cc: -sbirch@chromium.org
Owner: sbirch@chromium.org
Sam, any updates on this?
I don't have a very informed opinion here, but re-setting window.history.state seems like a bug which would affect any app depending on it in those circumstances. In the context of WebAPKs I don't see a good reason to force a re-fetch from the network, since as Yaron says, PWAs can (and should) control the loading behavior themselves.

I'd happily defer to anyone with better knowledge of the spec :).
I think we should effectively revert that older patch
Cc: sbirch@chromium.org
Owner: pkotw...@chromium.org
My comment on the CL:

I'm worried that pull to refresh is a) not obvious, and b) overridable (in fact, I thought there was some effort from Web Platform to try and put in a web spec to explicitly override pull to refresh). I'm not sure we should do this unless we get a much more reliable way to refresh in standalone web apps (like the regular tabbed browser has).
dominickn: do you object to doing this for webapks? seems like they are design to be apps and if the developer is requesting standalone treatment they should be designing for full nav control
If this is restricted to WebAPKs I have less concerns, though I still worry we'll have PWAs that intercept the refresh gesture but don't handle the refresh/reload in a robust way.
"though I still worry we'll have PWAs that intercept the refresh gesture but don't handle the refresh/reload in a robust way." 

:(
I mean, ya, I get that people write bugs but they're choosing to override the default browser behaviour so they are knowingly taking on this responsibility. The current situation actually makes it impossible for an advanced developer to use history state and only in the context of webapk (doesn't repro in tabbed browser) which is definitely something we try to avoid.
That's fair. Let's go ahead with this then.
Thanks, Dominick!
Project Member

Comment 15 by bugdroid1@chromium.org, Oct 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/094023a4b125962fd809c36bad3fbb088382507d

commit 094023a4b125962fd809c36bad3fbb088382507d
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Sat Oct 20 04:40:08 2018

[Android WebAPK] Preserve history state when relaunching WebAPK

This CL reverts  https://crbug.com/307333  for WebAPKs but not webapps.
That CL made webapps reload when a user:
- navigated back to a webapp via Android Recents
AND
- the webapp had been killed (which means that it is likely that a
  long time elapsed since the webapp was launched has passed)

A WebAPK user is using window.history.pushState() to cache that a web page
was reached by launching a WebAPK instead of by navigating on the web.
The behaviour introduced in  https://crbug.com/307333  was preventing the
history state from getting restored when the user navigates back to the
WebAPK via Android recents and Chrome has been killed.

The rationale for reverting the behaviour for WebAPKs but not webapps is
that WebAPKs are supposed to be sophisticated apps. Reloading the page
takes control away from web developers.

BUG= 888100 

Change-Id: Icb4803b0ee8b3444e0aade2acc2473b8ce1c23b7
Reviewed-on: https://chromium-review.googlesource.com/c/1275290
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601405}
[modify] https://crrev.com/094023a4b125962fd809c36bad3fbb088382507d/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java

Status: Fixed (was: Assigned)

Sign in to add a comment