[HandlingAppLinks]Avoid IntentChooser while navigation from https to http pages
Reported by
mathanku...@gmail.com,
Mar 16 2017
|
|||||
Issue descriptionSteps to reproduce the problem: 1) We are working on enabling our android app to handle http/https links. And for that we are using intent filters in our app manifest to declare the URI patterns that your app handles. The following example shows an intent filter that can handle links to http://www.example.in and https://www.example.in: <intent-filter> <data android:scheme="http" /> <data android:scheme="https" /> <data android:host="www.example.in" /> <data android:pathPattern=".*" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> 2) As per chrome implementation when navigating within the same host it will show an Intent App Chooser if there is a newer App available to handle the target url as compared to the apps which can handle the source/referrer url. Source Code Link : https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java?q=browser_fallback_url&sq=package:chromium&l=385 Essentially this means that when user navigates from a not-handled-in-app-url to a handled-in-app-url within the same host, chrome will show the Intent App Chooser. 3) In the intent filter i mentioned above, we are handling all the http/https links with domain name example.in. So while navigating with in the same host (ie : www.example.in) , there should not be any intent app chooser since both source and target pages are registered in the Android Manifest. 4) We are facing an issue while navigating between https to http pages in Android Google Chrome. Let me explain the issue in detail. i) Source : http://www.example.in/sourcepage Target : http://www.example.in/targetpage As you can see both source and destination pages are http and are also whitelisted in the Android Manifest. The expectation is not to open the Intent Handler and it works fine. ii) Source : http://www.example.in/sourcepage Target : https://www.example.in/targetpage Here source page is a http page and destination page is https page. Both pages are whitelisted in the Android Manifest.And it works as expected by not showing intent chooser. iii) Source : https://www.example.in/sourcepage Target : https://www.example.in/targetpage Here both source destination page are https. Both pages are whitelisted in the Android Manifest. And even in this case it works as expected by not showing intent chooser. iv) Source : https://www.example.in/sourcepage Target : http://www.example.in/targetpage Here source page is a https page and where as destination page is a http page. Both pages are whitelisted in the Android Manifest. And the expectation here is not to show intent chooser. But in this case an Intent Chooser is shown. We feel that this unexpected behaviour is an issue with google chrome. Can you please take a look at it and let us know that when can we expect the fix ? If there is any workaround you can suggest us to solve this issue, please let us know. What is the expected behavior? Intent Chooser should not be shown while navigating from https to http pages (Both the source and target pages are whitelisted in android manifest and belong to the same domain). What went wrong? Intent Chooser is shown while navigating from https to http pages (Both the source and target pages are whitelisted in android manifest and belong to the same domain). Did this work before? No Chrome version: 56.0.2924.87 Channel: stable OS Version: 6 Flash Version: We feel that this unexpected behaviour is an issue with google chrome which is affecting the end user experience. Can you please take a look at it and let us know that when can we expect the fix ? If there is any workaround you can suggest us to solve this issue, please let us know.
,
Mar 18 2017
,
Apr 10 2017
May be fixable. In ExternalNavigationHandler.java we currently handle the case of going between links on the same host. We should explore whether we can drop the scheme as part of the comparison.
,
Apr 13 2017
Is it possible to get the URL of a site that exhibits this behaviour?
,
May 1 2017
Actually we identified this issue while experimenting android:pathPattern=".*" in amazon india shopping android application and this behaviour is not specific to a particular url.We faced this behaviour in all the https://amazon.in/* to http://amazon.in/* transitions.
,
May 5 2017
,
May 10 2017
When can we expect the fix for this issue ? If you can give us an approximate date to expect for the fix, that would help us in our planning.
,
May 10 2017
We are working on it, but can't promise a specific timeline. If the fix lands here before May 25th, then it will go stable around August 1st, otherwise it will be in the next release scheduled for Sept 12th.
,
May 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/344a463dc6925a89b86baabffa306cf569303e01 commit 344a463dc6925a89b86baabffa306cf569303e01 Author: thildebr <thildebr@chromium.org> Date: Fri May 19 00:08:50 2017 Fixes intent chooser being shown incorrectly when going from HTTPS to HTTP for the same host. Since there's no referrer when going from HTTPS to HTTP, ExternalNavigationHandler incorrectly determines that an intent chooser should be shown even when navigating to a link within the same host. This uses WebContents' getLastCommittedUrl() to provide a fallback and avoid showing an intent chooser in this case. Adds ChromeBrowserTestRule as a JUnit rule so that AccountManagerHelper is initialized properly, since some recent changes caused tests that rely on its initialization to fail unless now explicitly initialized. BUG= 702089 Review-Url: https://codereview.chromium.org/2885983002 Cr-Commit-Position: refs/heads/master@{#472984} [modify] https://crrev.com/344a463dc6925a89b86baabffa306cf569303e01/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegate.java [modify] https://crrev.com/344a463dc6925a89b86baabffa306cf569303e01/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java [modify] https://crrev.com/344a463dc6925a89b86baabffa306cf569303e01/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java [modify] https://crrev.com/344a463dc6925a89b86baabffa306cf569303e01/chrome/android/java_sources.gni [modify] https://crrev.com/344a463dc6925a89b86baabffa306cf569303e01/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java [add] https://crrev.com/344a463dc6925a89b86baabffa306cf569303e01/chrome/android/javatests/src/org/chromium/chrome/browser/test/ChromeBrowserTestRule.java
,
May 19 2017
,
May 20 2017
When will this fix go live ? Can we expect this to be live on Aug 1st ?
,
May 22 2017
Yes, this will come out with M-60, currently scheduled on August 1st.
,
May 29 2017
I see that M-60 is a new chrome release version. Will this fix will also get released as a patch for the existing chrome versions like 56.0.2924.87 ?
,
Jun 1 2017
No. Users get updated to latest versions of Chrome through play store though.
,
Jun 19 2017
If you have any data on approximate percentage of android chrome user population who will likely get upgraded to the newer version that would help us in our release planning, Can you share that information with us ?
,
Jun 19 2017
Sorry, that's not something I am able to share. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by ppolise...@chromium.org
, Mar 17 2017Components: Mobile>Intents
Status: Available (was: Unconfirmed)