зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1198369 - Go to fallback url before searching store for Intent handler. r=margaret
This behavior mimics Chrome's. --HG-- extra : commitid : CXhcWDaP4Fn extra : rebase_source : 95c4d0047a31dbf3ed72c4c05d5cf59edc4c54f1
This commit is contained in:
Родитель
69e742b7a2
Коммит
304ded6791
|
@ -181,16 +181,19 @@ public final class IntentHelper implements GeckoEventListener,
|
|||
|
||||
// For this flow, we follow Chrome's lead:
|
||||
// https://developer.chrome.com/multidevice/android/intents
|
||||
//
|
||||
// Note on alternative flows: we could get the intent package from a component, however, for
|
||||
// security reasons, components are ignored when opening URIs (bug 1168998) so we should
|
||||
// ignore it here too.
|
||||
//
|
||||
// Our old flow used to prompt the user to search for their app in the market by scheme and
|
||||
// while this could help the user find a new app, there is not always a correlation in
|
||||
// scheme to application name and we could end up steering the user wrong (potentially to
|
||||
// malicious software). Better to leave that one alone.
|
||||
if (intent.getPackage() != null) {
|
||||
if (intent.hasExtra(EXTRA_BROWSER_FALLBACK_URL)) {
|
||||
final String fallbackUrl = intent.getStringExtra(EXTRA_BROWSER_FALLBACK_URL);
|
||||
callback.sendError(fallbackUrl);
|
||||
|
||||
} else if (intent.getPackage() != null) {
|
||||
// Note on alternative flows: we could get the intent package from a component, however, for
|
||||
// security reasons, components are ignored when opening URIs (bug 1168998) so we should
|
||||
// ignore it here too.
|
||||
//
|
||||
// Our old flow used to prompt the user to search for their app in the market by scheme and
|
||||
// while this could help the user find a new app, there is not always a correlation in
|
||||
// scheme to application name and we could end up steering the user wrong (potentially to
|
||||
// malicious software). Better to leave that one alone.
|
||||
final String marketUri = MARKET_INTENT_URI_PACKAGE_PREFIX + intent.getPackage();
|
||||
final Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(marketUri));
|
||||
marketIntent.addCategory(Intent.CATEGORY_BROWSABLE);
|
||||
|
@ -201,10 +204,6 @@ public final class IntentHelper implements GeckoEventListener,
|
|||
activity.startActivity(marketIntent);
|
||||
callback.sendSuccess(null);
|
||||
|
||||
} else if (intent.hasExtra(EXTRA_BROWSER_FALLBACK_URL)) {
|
||||
final String fallbackUrl = intent.getStringExtra(EXTRA_BROWSER_FALLBACK_URL);
|
||||
callback.sendError(fallbackUrl);
|
||||
|
||||
} else {
|
||||
// Don't log the URI to prevent leaking it.
|
||||
Log.w(LOGTAG, "Unable to open URI, default case - loading about:neterror");
|
||||
|
|
Загрузка…
Ссылка в новой задаче