Bug 1258605 - Don't show about:neterror when intents fail to load. r=margaret draft
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 25 Mar 2016 17:36:37 -0700
changeset 344870 155241087bd9cefdf72b065af10b9bfb0f05f1dc
parent 344820 81d754a0681160c34aa9ad4ba9d398d0d149eb7b
child 517059 baee3b324d3ffcbdea5f0e88aa1fdb68ef960979
push id13939
push usermichael.l.comella@gmail.com
push dateSat, 26 Mar 2016 00:36:45 +0000
Bug 1258605 - Don't show about:neterror when intents fail to load. r=margaret Motivations are in the added comment. MozReview-Commit-ID: 1EymB8rXzT5
--- 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.
                     activity, activity.getSupportFragmentManager(), marketIntent);
         }  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()));
+            callback.sendSuccess(null); // pretend we opened the page.
     private static boolean isFallbackUrlValid(@Nullable final String fallbackUrl) {
         if (fallbackUrl == null) {
             return false;