window.history.state is null when user selects WebAPK from recents after Chrome is killed |
|||||||
Issue descriptionRepro 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
,
Sep 24
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
,
Sep 24
+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.
,
Sep 25
I'm not familiar with the navigation / loading / SW side of the spec. foolip@ may be the right person?
,
Oct 1
Sam, any updates on this?
,
Oct 1
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 :).
,
Oct 2
I think we should effectively revert that older patch
,
Oct 11
,
Oct 11
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).
,
Oct 11
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
,
Oct 12
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.
,
Oct 12
"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.
,
Oct 15
That's fair. Let's go ahead with this then.
,
Oct 18
Thanks, Dominick!
,
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
,
Oct 22
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by pkotw...@chromium.org
, Sep 21