New issue
Advanced search Search tips

Issue 907250 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

webview does not call onPageFinished for history.push/replaceState

Project Member Reported by boliu@chromium.org, Nov 20

Issue description

This has been broken for awhile. This means these kind of navigations do not update the url bar of browsers that use webview. We've already handled this for fragment navigations by triggering an onPageFinished with no matching onPageStarted. We should do that for history.push/replaceState navigations too.

The fix is to change this to isSameDocument:
https://cs.chromium.org/chromium/src/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java?rcl=304f3ee41537a07c9f6d28b3ce6b31296b5cbe13&l=139

Should also add tests.

How urgent should this be? I figure given how long this has been broken, we should just do it in m72 instead?
 
This isn't urgent - it's not a security issue since you can only pushState within a single origin. We can just do it later.
Owner: boliu@chromium.org
Status: Assigned (was: Available)
https://chromium-review.googlesource.com/c/chromium/src/+/1345812
So turns out we had a test specifically to test that history.push/replaceState do *not* trigger onPageFinished, because we broke that behavior before and people complained: https://codereview.chromium.org/68763012/ and associated bugs

Then that fix broke onPageFinished for fragment navigations, which is then fixed here: https://codereview.chromium.org/139493008

And now we are trying to align history navigation to fragment navigation.

I don't think it changes anything here, except maybe we should be careful and add a finch kill switch..
Owner: ----
Status: Available (was: Assigned)
Actually, if we are going to use finch here, then I'd let someone else on the webview team do it, since that's quite a bit of commitment.. feel free to take that CL in #2, and follow similar steps in crbug.com/896022
Argh everything is terrible :|

Longer term here we should add a new API specifically for updating visible URL displays that triggers during navigation commit (i.e. the right time), for all navigation commits, and just tell people to use that and stop relying on onPageStarted/onPageFinished for anything important...
Cc: boliu@chromium.org
Labels: -Pri-1 -ReleaseBlock-Stable -M-72 M-73 Pri-2
Trying to roll this out via finch would be interesting, to see how that goes (both in terms of whether this breaks apps, and in terms of whether we can use finch successfully to get the feedback we need for a change like this), but I'm not sure who would have the bandwidth to do this. Dropping to P2 and removing releaseblock for now since as noted it's not a security risk (just a UI bug for some apps) and it may not be a compatible change. Also too late for 72.

Sign in to add a comment