Bug 1397894 - [1.0] Fix GeckoView custom tabs URI loading. r=snorp
authorEugen Sawin <esawin@mozilla.com>
Thu, 07 Sep 2017 22:02:05 +0200
changeset 429115 83d8880fbf0e4301a8c600fd40cdd4a36d50a1ab
parent 429114 c855cf7aa13b5c38d9c9aba98fa1467c95c0988b
child 429116 78ab7b444a9c125ead34fae6777021d8103571d7
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1397894
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1397894 - [1.0] Fix GeckoView custom tabs URI loading. r=snorp
mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
@@ -539,25 +539,24 @@ public class CustomTabsActivity extends 
     public void onCanGoForward(GeckoView view, boolean canGoForward) {
         mCanGoForward = canGoForward;
         updateMenuItemForward();
     }
 
     @Override
     public boolean onLoadUri(final GeckoView view, final String uriStr,
                              final TargetWindow where) {
+        if (where != TargetWindow.NEW) {
+            return false;
+        }
+
         final Uri uri = Uri.parse(uriStr);
-        if (!TextUtils.isEmpty(mCurrentUrl) &&
-            Uri.parse(mCurrentUrl).getHost().equals(uri.getHost())) {
-            view.loadUri(uri);
-        } else {
-            final Intent intent = new Intent(Intent.ACTION_VIEW);
-            intent.setData(uri);
-            startActivity(intent);
-        }
+        final Intent intent = new Intent(Intent.ACTION_VIEW);
+        intent.setData(uri);
+        startActivity(intent);
         return true;
     }
 
     /* GeckoView.ProgressListener */
     @Override
     public void onPageStart(GeckoView view, String url) {
         mCurrentUrl = url;
         mCanStop = true;