CB-5592 Add a comment explaining why we set MIME only for file:
This commit is contained in:
parent
176890f305
commit
6163f17aeb
@ -300,6 +300,8 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
try {
|
try {
|
||||||
Intent intent = null;
|
Intent intent = null;
|
||||||
intent = new Intent(Intent.ACTION_VIEW);
|
intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
// 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.
|
||||||
Uri uri = Uri.parse(url);
|
Uri uri = Uri.parse(url);
|
||||||
if ("file".equals(uri.getScheme())) {
|
if ("file".equals(uri.getScheme())) {
|
||||||
intent.setDataAndType(uri, webView.getResourceApi().getMimeType(uri));
|
intent.setDataAndType(uri, webView.getResourceApi().getMimeType(uri));
|
||||||
|
Loading…
Reference in New Issue
Block a user