diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-06-09 17:09:27 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-06-09 17:09:27 +0300 |
commit | f078642eb9a440f6aa88f2beaf10f445de1e29bb (patch) | |
tree | db3cf4c1d2b9503ca5cba0ea4fc1fcc468e9922f | |
parent | 7e941648610ff4033ae8f9709077edd0595364f0 (diff) | |
parent | f80cd0f766094e01da1008d14123a12740a2b771 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.11' into tqtc/lts-5.15-opensourcev5.15.11-lts-lgpl
Change-Id: I2046d8851ce24cfa70e7750d7ba6f2f0ae8f49cc
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | src/jar/src/org/qtproject/qt5/android/view/QtAndroidWebViewController.java | 9 | ||||
-rw-r--r-- | src/webview/doc/src/qtwebview-overview.qdoc | 9 |
3 files changed, 19 insertions, 1 deletions
diff --git a/.qmake.conf b/.qmake.conf index fc21140..730c788 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) DEFINES += QT_NO_FOREACH -MODULE_VERSION = 5.15.10 +MODULE_VERSION = 5.15.11 diff --git a/src/jar/src/org/qtproject/qt5/android/view/QtAndroidWebViewController.java b/src/jar/src/org/qtproject/qt5/android/view/QtAndroidWebViewController.java index 5295c35..ebfe8da 100644 --- a/src/jar/src/org/qtproject/qt5/android/view/QtAndroidWebViewController.java +++ b/src/jar/src/org/qtproject/qt5/android/view/QtAndroidWebViewController.java @@ -220,6 +220,15 @@ public class QtAndroidWebViewController webSettings.setDatabaseEnabled(true); webSettings.setDomStorageEnabled(true); + // Before API level 30 accessing local files was enabled by default. + final boolean allowFileAccess = (System.getenv("QT5_ANDROID_WEBVIEW_ALLOW_FILE_ACCESS") != null); + if (allowFileAccess) + webSettings.setAllowFileAccess(allowFileAccess); + + final boolean allowFileAccessFromFileUrls = (System.getenv("QT5_ANDROID_WEBVIEW_ALLOW_FILE_ACCESS_FROM_URLS") != null); + if (allowFileAccessFromFileUrls) + webSettings.setAllowFileAccessFromFileURLs(allowFileAccessFromFileUrls); + if (Build.VERSION.SDK_INT > 10) { try { m_webViewOnResume = m_webView.getClass().getMethod("onResume"); diff --git a/src/webview/doc/src/qtwebview-overview.qdoc b/src/webview/doc/src/qtwebview-overview.qdoc index dc59f3c..b008064 100644 --- a/src/webview/doc/src/qtwebview-overview.qdoc +++ b/src/webview/doc/src/qtwebview-overview.qdoc @@ -62,6 +62,15 @@ is not supported. Doing this will have unpredictable results which may differ from platform to platform. + \section1 Platform notes + + \secion2 Android + + From API level 30 the native Android WebView will have file access disabled by default. + Since there are no APIs in QtWebView to override the file access property, the two environment variables + QT5_ANDROID_WEBVIEW_ALLOW_FILE_ACCESS and QT5_ANDROID_WEBVIEW_ALLOW_FILE_ACCESS_FROM_URLS are provided + which, when set, re-enables file access support again. + \section1 Examples Take a look at the \l{Qt WebView Examples} for a demonstration on |