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.
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()));
+ callback.sendSuccess(null); // pretend we opened the page.
}
}
private static boolean isFallbackUrlValid(@Nullable final String fallbackUrl) {
if (fallbackUrl == null) {
return false;
}