Skip to content

Commit afe5d7f

Browse files
fix(android): Allow loading local files
(apache#883)
1 parent ae0d8f6 commit afe5d7f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/android/InAppBrowser.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,13 @@ public boolean onShowFileChooser (WebView webView, ValueCallback<Uri[]> filePath
955955
settings.setBuiltInZoomControls(showZoomControls);
956956
settings.setPluginState(android.webkit.WebSettings.PluginState.ON);
957957

958+
if (preferences.getBoolean("AndroidInsecureFileModeEnabled", false)) {
959+
LOG.d(LOG_TAG, "Enabled insecure file access");
960+
961+
settings.setAllowFileAccess(true);
962+
settings.setAllowUniversalAccessFromFileURLs(true);
963+
}
964+
958965
// Add postMessage interface
959966
class JsObject {
960967
@JavascriptInterface

0 commit comments

Comments
 (0)