Skip to content

Commit

Permalink
Add 'application/octet-stream' to the list of types when choosing use…
Browse files Browse the repository at this point in the history
…r.js

Files not from Downloads may come with this type
  • Loading branch information
modos189 authored and johndoe committed Oct 5, 2019
1 parent 1257414 commit d0b34c3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,13 @@ public boolean onOptionsItemSelected(final MenuItem item) {
if (mFileManager.checkWriteStoragePermissionGranted()) {
// create the chooser Intent
final Intent target = new Intent(Intent.ACTION_GET_CONTENT);

target.setType("*/*");
// iitcm only parses *.user.js scripts
target.setType("application/javascript");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
String[] mimeTypes = {"application/javascript", "application/octet-stream"};
target.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
}
target.addCategory(Intent.CATEGORY_OPENABLE);

try {
Expand Down

0 comments on commit d0b34c3

Please sign in to comment.