New issue
Advanced search Search tips

Issue 761663 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Facebook OAuth redirection with authorization code in WebView always launches Chrome browser

Reported by arunp1...@gmail.com, Sep 3 2017

Issue description

Steps to reproduce the problem:
1. Do facebook oauth flow in Android WebView. Facebook does not allow to give custom url. So, give any http url, e.g: http://localhost
2. After authentication, when facebook redirects to OAuth redirect url, chrome mobile browser is launched. This redirection from facebook is detected in onPageStarted callback on WebView. I stop the loading when this is detected [view.stopLoading();]. But, webview goes ahead and launches the chrome browser. If there are multiple browsers, the option to select one of the available browsers in shown.

What is the expected behavior?
The chrome browser SHOULD NOT be launched automatically on OAuth redirect. Even if there are multiple browsers, the option to select one of the available browsers SHOULD NOT be shown.

What went wrong?
Same as mentioned above. Copy pasting the same here:
After authentication, when facebook redirects to OAuth redirect url, chrome mobile browser is launched. This redirection from facebook is detected in onPageStarted callback on WebView. I stop the loading when this is detected [view.stopLoading();]. But, webview goes ahead and launches the chrome browser. If there are multiple browsers, the option to select one of the available browsers in shown.

Did this work before? Yes This worked fine with Android System WebView 44.0.2403.117, Nexus 9, Android 6.0.1.

Chrome version: 60.0.3112.107  Channel: stable
OS Version: 7.0.0
Flash Version: 

This issue is also reproducible on Android 7.0, Nexus 6, with webview implementation as "Chrome stable". Chrome version being 60.0.3112.107
 
Components: Mobile>WebView

Comment 2 by torne@chromium.org, Sep 5 2017

Labels: Needs-Feedback
WebView only ever automatically launches an external app to handle links if you haven't set a WebViewClient at all. If you've defined a WebViewClient for the current WebView then this should not happen, and the behaviour is instead entirely controlled by your WebViewClient's implementation of shouldOverrideUrlLoading. If you see some other behaviour you'll have to provide an example app that reproduces the problem (with source code), because this isn't how it's intended to behave.

Trying to prevent redirections by calling stopLoading in status callbacks isn't going to work because the status callbacks are asynchronous (loading is continuing to happen on another thread while your callback is running, so by the time you call stopLoading it's probably too late. If you want to control how URL loads are handled you should be implementing shouldOverrideUrlLoading and returning an appropriate value to tell the WebView what to do.
Project Member

Comment 3 by sheriffbot@chromium.org, Oct 6 2017

Status: Archived (was: Unconfirmed)
No feedback was received in the last 30 days from reporter "arunp1990@gmail.com", so archiving this. Please re-open or file a new bug if this is still an issue.

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

Sign in to add a comment