Bug 1258605 - Don't show about:neterror when intents fail to load. r=margaret
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 25 Mar 2016 17:36:37 -0700
changeset 290718 971ee95dade06b20742e94d58c471e76705ca478
parent 290717 34a3c2d3359fb3b233a2a46f4e176459ace6b354
child 290783 d5d53a3b4e50b94cdf85d20690526e5a00d5b63e
child 290784 c325569a1f4dc0cd049d3f439ee20318842740b1
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1258605
milestone48.0a1
Bug 1258605 - Don't show about:neterror when intents fail to load. r=margaret Motivations are in the added comment. MozReview-Commit-ID: 1EymB8rXzT5
mobile/android/base/java/org/mozilla/gecko/IntentHelper.java
--- a/mobile/android/base/java/org/mozilla/gecko/IntentHelper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/IntentHelper.java
@@ -206,19 +206,27 @@ public final class IntentHelper implemen
 
             // (Bug 1192436) We don't know if marketIntent matches any Activities (e.g. non-Play
             // Store devices). If it doesn't, clicking the link will cause no action to occur.
             ExternalIntentDuringPrivateBrowsingPromptFragment.showDialogOrAndroidChooser(
                     activity, activity.getSupportFragmentManager(), marketIntent);
             callback.sendSuccess(null);
 
         }  else {
+            // We originally loaded about:neterror when we failed to match the Intent. However, many
+            // websites worked around Chrome's implementation, which does nothing in this case. For
+            // example, the site might set a timeout and load a play store url for their app if the
+            // intent link fails to load, i.e. the app is not installed. These work-arounds would often
+            // end with our users seeing about:neterror instead of the intended experience. While I
+            // feel showing about:neterror is a better solution for users (when not hacked around),
+            // we should match the status quo for the good of our users.
+            //
             // Don't log the URI to prevent leaking it.
-            Log.w(LOGTAG, "Unable to open URI, default case - loading about:neterror");
-            callback.sendError(getUnknownProtocolErrorPageUri(intent.getData().toString()));
+            Log.w(LOGTAG, "Unable to open URI - ignoring click");
+            callback.sendSuccess(null); // pretend we opened the page.
         }
     }
 
     private static boolean isFallbackUrlValid(@Nullable final String fallbackUrl) {
         if (fallbackUrl == null) {
             return false;
         }