From 747d2c97cdd3ea3927b6f9ab7e774040f8d9e245 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Mon, 2 Mar 2015 21:01:06 -0500 Subject: [PATCH] CB-8588 Add CATEGORY_BROWSABLE to intents from showWebPage openExternal=true --- framework/src/org/apache/cordova/CordovaWebViewImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/src/org/apache/cordova/CordovaWebViewImpl.java b/framework/src/org/apache/cordova/CordovaWebViewImpl.java index a7dd41a9..744bd444 100644 --- a/framework/src/org/apache/cordova/CordovaWebViewImpl.java +++ b/framework/src/org/apache/cordova/CordovaWebViewImpl.java @@ -232,10 +232,12 @@ public class CordovaWebViewImpl implements CordovaWebView { return; } try { + Intent intent = new Intent(Intent.ACTION_VIEW); + // To send an intent without CATEGORY_BROWSER, a custom plugin should be used. + intent.addCategory(Intent.CATEGORY_BROWSABLE); + Uri uri = Uri.parse(url); // Omitting the MIME type for file: URLs causes "No Activity found to handle Intent". // Adding the MIME type to http: URLs causes them to not be handled by the downloader. - Intent intent = new Intent(Intent.ACTION_VIEW); - Uri uri = Uri.parse(url); if ("file".equals(uri.getScheme())) { intent.setDataAndType(uri, resourceApi.getMimeType(uri)); } else {