Skip to content

Commit

Permalink
fix(android): Allow loading local files
Browse files Browse the repository at this point in the history
  • Loading branch information
jeansparipassu committed Nov 8, 2021
1 parent ae0d8f6 commit afe5d7f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/android/InAppBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,13 @@ public boolean onShowFileChooser (WebView webView, ValueCallback<Uri[]> filePath
settings.setBuiltInZoomControls(showZoomControls);
settings.setPluginState(android.webkit.WebSettings.PluginState.ON);

if (preferences.getBoolean("AndroidInsecureFileModeEnabled", false)) {
LOG.d(LOG_TAG, "Enabled insecure file access");

settings.setAllowFileAccess(true);
settings.setAllowUniversalAccessFromFileURLs(true);
}

// Add postMessage interface
class JsObject {
@JavascriptInterface
Expand Down

0 comments on commit afe5d7f

Please sign in to comment.