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

Issue 788775 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug

Blocking:
issue 766255



Sign in to add a comment

[PlzNavigate] WebView causes onReceivedError on redirects with invalid url schemes

Project Member Reported by gsennton@chromium.org, Nov 27 2017

Issue description

See b/69352309 for context.

WebView should not complain when handling URLs with incorrect url schemes as long as those URLs are handled in shouldOverrideUrlLoading. With PlzNavigate we are checking the schemes of URLs (that are the result of a redirect) before passing them to ShouldOverrideUrlLoading - this is incorrect and should be fixed.


Should this target / be merged to 63?
 

Comment 1 by clamy@chromium.org, Nov 27 2017

I think it should - we're trying to launch with PlzNavigate enabled on M63, so this is likely to be an issue.

Comment 2 by boliu@chromium.org, Nov 27 2017

Labels: -Pri-2 ReleaseBlock-Stable M-63 Pri-1

Comment 3 by boliu@chromium.org, Nov 27 2017

Blocking: 766255
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 28 2017

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

commit 4793571a1e9a585b6143bc63f2525dbea5c62906
Author: Gustav Sennton <gsennton@google.com>
Date: Tue Nov 28 17:34:51 2017

Call shouldOverrideUrlLoading before verifying redirect url.

WebView should not post onReceivedError when shouldOverrideUrlLoading
returns true for invalid url schemes - with PlzNavigate we do post
onReceivedError when the url checked is a server redirect.
This CL fixes that issue by calling shouldOverrideUrlLoading before
verifying that the scheme of the new target url in the redirect is
valid.

Note: if the url is overridden we still update the state of the
navigation handle to point to the new url, this is to ensure the WebView
(Aw)WebContentsObserver sees the new url.

BUG= 788775 

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I4ad36e3ae3feaa39a00024282752c02bbe88bd6f
Reviewed-on: https://chromium-review.googlesource.com/790993
Commit-Queue: Gustav Sennton <gsennton@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519724}
[modify] https://crrev.com/4793571a1e9a585b6143bc63f2525dbea5c62906/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java
[modify] https://crrev.com/4793571a1e9a585b6143bc63f2525dbea5c62906/content/browser/frame_host/navigation_handle_impl.cc
[modify] https://crrev.com/4793571a1e9a585b6143bc63f2525dbea5c62906/content/browser/frame_host/navigation_handle_impl.h
[modify] https://crrev.com/4793571a1e9a585b6143bc63f2525dbea5c62906/content/browser/frame_host/navigation_request.cc

Labels: Merge-Request-63
Project Member

Comment 6 by sheriffbot@chromium.org, Nov 29 2017

Labels: -Merge-Request-63 Merge-Review-63 Hotlist-Merge-Review
This bug requires manual review: We are only 5 days from stable.
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), gkihumba@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by cma...@chromium.org, Nov 29 2017

Labels: -Hotlist-Merge-Review -Merge-Review-63 Merge-Approved-63
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 29 2017

Labels: -merge-approved-63 merge-merged-3239
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fd1da640d9f8b273ba1d786531cc119445733341

commit fd1da640d9f8b273ba1d786531cc119445733341
Author: Gustav Sennton <gsennton@google.com>
Date: Wed Nov 29 16:29:16 2017

Call shouldOverrideUrlLoading before verifying redirect url.

WebView should not post onReceivedError when shouldOverrideUrlLoading
returns true for invalid url schemes - with PlzNavigate we do post
onReceivedError when the url checked is a server redirect.
This CL fixes that issue by calling shouldOverrideUrlLoading before
verifying that the scheme of the new target url in the redirect is
valid.

Note: if the url is overridden we still update the state of the
navigation handle to point to the new url, this is to ensure the WebView
(Aw)WebContentsObserver sees the new url.

BUG= 788775 

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I4ad36e3ae3feaa39a00024282752c02bbe88bd6f
Reviewed-on: https://chromium-review.googlesource.com/790993
Commit-Queue: Gustav Sennton <gsennton@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#519724}(cherry picked from commit 4793571a1e9a585b6143bc63f2525dbea5c62906)
Reviewed-on: https://chromium-review.googlesource.com/797090
Cr-Commit-Position: refs/branch-heads/3239@{#608}
Cr-Branched-From: adb61db19020ed8ecee5e91b1a0ea4c924ae2988-refs/heads/master@{#508578}
[modify] https://crrev.com/fd1da640d9f8b273ba1d786531cc119445733341/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java
[modify] https://crrev.com/fd1da640d9f8b273ba1d786531cc119445733341/content/browser/frame_host/navigation_handle_impl.cc
[modify] https://crrev.com/fd1da640d9f8b273ba1d786531cc119445733341/content/browser/frame_host/navigation_handle_impl.h
[modify] https://crrev.com/fd1da640d9f8b273ba1d786531cc119445733341/content/browser/frame_host/navigation_request.cc

Status: Fixed (was: Assigned)
Marking this as fixed for now. Will follow-up with the test-team on the buganizer bug - b/69352309
Status: Verified (was: Fixed)
Verified on Pixel Xl/ OPM1.171019.013 having Monochrome 64.0.3282.7 , Login issue no longer reproducible with the apk provided on  b/69352309 as per comment #11. Thanks for the fix.
Verified on 63.0.3239.83 on Pixel 2XL/OPM1.171019.013 with apk provided and no longer issue is reproducible mentioned in b/69352309

Sign in to add a comment