Commit d96ea028 authored by Lorenzo Pichilli's avatar Lorenzo Pichilli

fix #654, updated README.md

parent f0d49a84
## 5.0.0-nullsafety.0 ## 5.0.0-nullsafety.0
- Added support for Dart null-safety feature - Added support for Dart null-safety feature
- Updated integration tests
- Added Android Hybrid Composition support "Use PlatformViewLink widget for Android WebView" [#462](https://github.com/pichillilorenzo/flutter_inappwebview/pull/462) (thanks to [plateaukao](https://github.com/plateaukao) and [tneotia](https://github.com/tneotia)) - Added Android Hybrid Composition support "Use PlatformViewLink widget for Android WebView" [#462](https://github.com/pichillilorenzo/flutter_inappwebview/pull/462) (thanks to [plateaukao](https://github.com/plateaukao) and [tneotia](https://github.com/tneotia))
- Added `allowUniversalAccessFromFileURLs` and `allowFileAccessFromFileURLs` WebView options also for iOS (also thanks to [liranhao](https://github.com/liranhao))
- Updated integration tests
- Merge "Upgraded appcompat to 1.2.0-rc-02" [#465](https://github.com/pichillilorenzo/flutter_inappwebview/pull/465) (thanks to [andreidiaconu](https://github.com/andreidiaconu)) - Merge "Upgraded appcompat to 1.2.0-rc-02" [#465](https://github.com/pichillilorenzo/flutter_inappwebview/pull/465) (thanks to [andreidiaconu](https://github.com/andreidiaconu))
- Merge "Added missing field 'headers' which returned by WebResourceResponse.toMap()" [#490](https://github.com/pichillilorenzo/flutter_inappwebview/pull/490) (thanks to [Doflatango](https://github.com/Doflatango)) - Merge "Added missing field 'headers' which returned by WebResourceResponse.toMap()" [#490](https://github.com/pichillilorenzo/flutter_inappwebview/pull/490) (thanks to [Doflatango](https://github.com/Doflatango))
- Merge "Fix: added iOS fallback module import" [#466](https://github.com/pichillilorenzo/flutter_inappwebview/pull/466) (thanks to [Eddayy](https://github.com/Eddayy)) - Merge "Fix: added iOS fallback module import" [#466](https://github.com/pichillilorenzo/flutter_inappwebview/pull/466) (thanks to [Eddayy](https://github.com/Eddayy))
...@@ -16,11 +17,13 @@ ...@@ -16,11 +17,13 @@
- Fixed "Android CookieManager throws error caused by websites that are sending back illegal/invalid cookies." [#476](https://github.com/pichillilorenzo/flutter_inappwebview/issues/476) - Fixed "Android CookieManager throws error caused by websites that are sending back illegal/invalid cookies." [#476](https://github.com/pichillilorenzo/flutter_inappwebview/issues/476)
- Fixed missing `clearHistory` webview method implementation on Android - Fixed missing `clearHistory` webview method implementation on Android
- Fixed iOS crash when using CookieManager getCookies for an URL and the host URL is `null` - Fixed iOS crash when using CookieManager getCookies for an URL and the host URL is `null`
- Fixed "IOS does not support allowUniversalAccessFromFileURLs" [#654](https://github.com/pichillilorenzo/flutter_inappwebview/issues/654)
### BREAKING CHANGES ### BREAKING CHANGES
- Minimum Flutter version required is `1.22.0` and Dart SDK `>=2.12.0-0 <3.0.0` - Minimum Flutter version required is `1.22.0` and Dart SDK `>=2.12.0-0 <3.0.0`
- Removed `debuggingEnabled` WebView option; on Android you should use now the `AndroidInAppWebViewController.setWebContentsDebuggingEnabled(bool debuggingEnabled)` static method; on iOS, debugging is always enabled - Removed `debuggingEnabled` WebView option; on Android you should use now the `AndroidInAppWebViewController.setWebContentsDebuggingEnabled(bool debuggingEnabled)` static method; on iOS, debugging is always enabled
- `allowUniversalAccessFromFileURLs` and `allowFileAccessFromFileURLs` WebView options moved from Android-specific options to cross-platform options.
## 4.0.0+4 ## 4.0.0+4
......
This diff is collapsed.
...@@ -43,6 +43,8 @@ public class InAppWebViewOptions implements Options<InAppWebView> { ...@@ -43,6 +43,8 @@ public class InAppWebViewOptions implements Options<InAppWebView> {
public Boolean disableHorizontalScroll = false; public Boolean disableHorizontalScroll = false;
public Boolean disableContextMenu = false; public Boolean disableContextMenu = false;
public Boolean supportZoom = true; public Boolean supportZoom = true;
public Boolean allowFileAccessFromFileURLs = false;
public Boolean allowUniversalAccessFromFileURLs = false;
public Integer textZoom = 100; public Integer textZoom = 100;
public Boolean clearSessionCache = false; public Boolean clearSessionCache = false;
...@@ -55,8 +57,6 @@ public class InAppWebViewOptions implements Options<InAppWebView> { ...@@ -55,8 +57,6 @@ public class InAppWebViewOptions implements Options<InAppWebView> {
public Integer mixedContentMode; public Integer mixedContentMode;
public Boolean allowContentAccess = true; public Boolean allowContentAccess = true;
public Boolean allowFileAccess = true; public Boolean allowFileAccess = true;
public Boolean allowFileAccessFromFileURLs = true;
public Boolean allowUniversalAccessFromFileURLs = true;
public String appCachePath; public String appCachePath;
public Boolean blockNetworkImage = false; public Boolean blockNetworkImage = false;
public Boolean blockNetworkLoads = false; public Boolean blockNetworkLoads = false;
......
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/.pub-cache/git/plugins-16f3281b04b0db12e609352b1c9544901392e428/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.4/","dependencies":[]}],"android":[{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/.pub-cache/git/plugins-16f3281b04b0db12e609352b1c9544901392e428/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.4/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+8/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.1.0-nullsafety.2/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.1.0-nullsafety.3/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.4+3/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.1.0-nullsafety.2/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-01-28 16:30:24.941683","version":"1.26.0-13.0.pre.194"} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/.pub-cache/git/plugins-16f3281b04b0db12e609352b1c9544901392e428/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.4/","dependencies":[]}],"android":[{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/.pub-cache/git/plugins-16f3281b04b0db12e609352b1c9544901392e428/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.4/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+8/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.1.0-nullsafety.2/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.1.0-nullsafety.3/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.4+3/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.1.0-nullsafety.2/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-01-28 18:33:22.830881","version":"1.26.0-13.0.pre.194"}
\ No newline at end of file \ No newline at end of file
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter" export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example" export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/lib/main.dart" export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios" export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1" export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue,FLUTTER_WEB_AUTO_DETECT%3Dtrue"
export "DART_OBFUSCATION=false" export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true" export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false" export "TREE_SHAKE_ICONS=true"
export "PACKAGE_CONFIG=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/.dart_tool/package_config.json" export "PACKAGE_CONFIG=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/.dart_tool/package_config.json"
...@@ -85,7 +85,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> { ...@@ -85,7 +85,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewGroupOptions( initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions( crossPlatform: InAppWebViewOptions(
useShouldOverrideUrlLoading: false useShouldOverrideUrlLoading: false,
), ),
android: AndroidInAppWebViewOptions( android: AndroidInAppWebViewOptions(
useHybridComposition: true useHybridComposition: true
...@@ -125,6 +125,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> { ...@@ -125,6 +125,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
setState(() { setState(() {
this.url = url ?? ''; this.url = url ?? '';
}); });
print(await controller.getOptions());
}, },
onProgressChanged: (controller, progress) { onProgressChanged: (controller, progress) {
setState(() { setState(() {
......
...@@ -1352,6 +1352,14 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi ...@@ -1352,6 +1352,14 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
configuration.suppressesIncrementalRendering = options.suppressesIncrementalRendering configuration.suppressesIncrementalRendering = options.suppressesIncrementalRendering
configuration.selectionGranularity = WKSelectionGranularity.init(rawValue: options.selectionGranularity)! configuration.selectionGranularity = WKSelectionGranularity.init(rawValue: options.selectionGranularity)!
if options.allowUniversalAccessFromFileURLs {
configuration.setValue(options.allowUniversalAccessFromFileURLs, forKey: "allowUniversalAccessFromFileURLs")
}
if options.allowFileAccessFromFileURLs {
configuration.preferences.setValue(options.allowFileAccessFromFileURLs, forKey: "allowFileAccessFromFileURLs")
}
if #available(iOS 9.0, *) { if #available(iOS 9.0, *) {
if options.incognito { if options.incognito {
configuration.websiteDataStore = WKWebsiteDataStore.nonPersistent() configuration.websiteDataStore = WKWebsiteDataStore.nonPersistent()
...@@ -1748,6 +1756,14 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi ...@@ -1748,6 +1756,14 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
} }
} }
if newOptionsMap["allowUniversalAccessFromFileURLs"] != nil && options?.allowUniversalAccessFromFileURLs != newOptions.allowUniversalAccessFromFileURLs {
configuration.setValue(newOptions.allowUniversalAccessFromFileURLs, forKey: "allowUniversalAccessFromFileURLs")
}
if newOptionsMap["allowFileAccessFromFileURLs"] != nil && options?.allowFileAccessFromFileURLs != newOptions.allowFileAccessFromFileURLs {
configuration.preferences.setValue(newOptions.allowFileAccessFromFileURLs, forKey: "allowFileAccessFromFileURLs")
}
if newOptionsMap["clearCache"] != nil && newOptions.clearCache { if newOptionsMap["clearCache"] != nil && newOptions.clearCache {
clearCache() clearCache()
} }
......
...@@ -34,6 +34,8 @@ public class InAppWebViewOptions: Options<InAppWebView> { ...@@ -34,6 +34,8 @@ public class InAppWebViewOptions: Options<InAppWebView> {
var disableHorizontalScroll = false var disableHorizontalScroll = false
var disableContextMenu = false var disableContextMenu = false
var supportZoom = true var supportZoom = true
var allowUniversalAccessFromFileURLs = false
var allowFileAccessFromFileURLs = false
var disallowOverScroll = false var disallowOverScroll = false
var enableViewportScale = false var enableViewportScale = false
...@@ -105,6 +107,8 @@ public class InAppWebViewOptions: Options<InAppWebView> { ...@@ -105,6 +107,8 @@ public class InAppWebViewOptions: Options<InAppWebView> {
realOptions["isPagingEnabled"] = webView.scrollView.isPagingEnabled realOptions["isPagingEnabled"] = webView.scrollView.isPagingEnabled
realOptions["maximumZoomScale"] = webView.scrollView.maximumZoomScale realOptions["maximumZoomScale"] = webView.scrollView.maximumZoomScale
realOptions["minimumZoomScale"] = webView.scrollView.minimumZoomScale realOptions["minimumZoomScale"] = webView.scrollView.minimumZoomScale
realOptions["allowUniversalAccessFromFileURLs"] = configuration.value(forKey: "allowUniversalAccessFromFileURLs")
realOptions["allowFileAccessFromFileURLs"] = configuration.preferences.value(forKey: "allowFileAccessFromFileURLs")
} }
return realOptions return realOptions
} }
......
...@@ -170,6 +170,28 @@ class InAppWebViewOptions ...@@ -170,6 +170,28 @@ class InAppWebViewOptions
///Set to `false` if the WebView should not support zooming using its on-screen zoom controls and gestures. The default value is `true`. ///Set to `false` if the WebView should not support zooming using its on-screen zoom controls and gestures. The default value is `true`.
bool supportZoom; bool supportZoom;
///Sets whether cross-origin requests in the context of a file scheme URL should be allowed to access content from other file scheme URLs.
///Note that some accesses such as image HTML elements don't follow same-origin rules and aren't affected by this setting.
///
///Don't enable this setting if you open files that may be created or altered by external sources.
///Enabling this setting allows malicious scripts loaded in a `file://` context to access arbitrary local files including WebView cookies and app private data.
///
///Note that the value of this setting is ignored if the value of [allowUniversalAccessFromFileURLs] is `true`.
///
///The default value is `false`.
bool allowFileAccessFromFileURLs;
///Sets whether cross-origin requests in the context of a file scheme URL should be allowed to access content from any origin.
///This includes access to content from other file scheme URLs or web contexts.
///Note that some access such as image HTML elements doesn't follow same-origin rules and isn't affected by this setting.
///
///Don't enable this setting if you open files that may be created or altered by external sources.
///Enabling this setting allows malicious scripts loaded in a `file://` context to launch cross-site scripting attacks,
///either accessing arbitrary local files including WebView cookies, app private data or even credentials used on arbitrary web sites.
///
///The default value is `false`.
bool allowUniversalAccessFromFileURLs;
InAppWebViewOptions( InAppWebViewOptions(
{this.useShouldOverrideUrlLoading = false, {this.useShouldOverrideUrlLoading = false,
this.useOnLoadResource = false, this.useOnLoadResource = false,
...@@ -194,7 +216,9 @@ class InAppWebViewOptions ...@@ -194,7 +216,9 @@ class InAppWebViewOptions
this.disableVerticalScroll = false, this.disableVerticalScroll = false,
this.disableHorizontalScroll = false, this.disableHorizontalScroll = false,
this.disableContextMenu = false, this.disableContextMenu = false,
this.supportZoom = true}) { this.supportZoom = true,
this.allowFileAccessFromFileURLs = false,
this.allowUniversalAccessFromFileURLs = false}) {
if (this.minimumFontSize == null) if (this.minimumFontSize == null)
this.minimumFontSize = defaultTargetPlatform == TargetPlatform.android ? 8 : 0; this.minimumFontSize = defaultTargetPlatform == TargetPlatform.android ? 8 : 0;
assert(!this.resourceCustomSchemes.contains("http") && assert(!this.resourceCustomSchemes.contains("http") &&
...@@ -232,7 +256,9 @@ class InAppWebViewOptions ...@@ -232,7 +256,9 @@ class InAppWebViewOptions
"disableVerticalScroll": disableVerticalScroll, "disableVerticalScroll": disableVerticalScroll,
"disableHorizontalScroll": disableHorizontalScroll, "disableHorizontalScroll": disableHorizontalScroll,
"disableContextMenu": disableContextMenu, "disableContextMenu": disableContextMenu,
"supportZoom": supportZoom "supportZoom": supportZoom,
"allowFileAccessFromFileURLs": allowFileAccessFromFileURLs,
"allowUniversalAccessFromFileURLs": allowUniversalAccessFromFileURLs
}; };
} }
...@@ -277,6 +303,8 @@ class InAppWebViewOptions ...@@ -277,6 +303,8 @@ class InAppWebViewOptions
options.disableHorizontalScroll = map["disableHorizontalScroll"]; options.disableHorizontalScroll = map["disableHorizontalScroll"];
options.disableContextMenu = map["disableContextMenu"]; options.disableContextMenu = map["disableContextMenu"];
options.supportZoom = map["supportZoom"]; options.supportZoom = map["supportZoom"];
options.allowFileAccessFromFileURLs = map["allowFileAccessFromFileURLs"];
options.allowUniversalAccessFromFileURLs = map["allowUniversalAccessFromFileURLs"];
return options; return options;
} }
...@@ -338,19 +366,9 @@ class AndroidInAppWebViewOptions ...@@ -338,19 +366,9 @@ class AndroidInAppWebViewOptions
bool allowContentAccess; bool allowContentAccess;
///Enables or disables file access within WebView. Note that this enables or disables file system access only. ///Enables or disables file access within WebView. Note that this enables or disables file system access only.
///Assets and resources are still accessible using \file:///android_asset` and `file:///android_res`. The default value is `true`. ///Assets and resources are still accessible using `file:///android_asset` and `file:///android_res`. The default value is `true`.
bool allowFileAccess; bool allowFileAccess;
///Sets whether JavaScript running in the context of a file scheme URL should be allowed to access content from other file scheme URLs.
///Note that the value of this setting is ignored if the value of [allowFileAccessFromFileURLs] is `true`.
///Note too, that this setting affects only JavaScript access to file scheme resources. The default value is `false`.
bool allowFileAccessFromFileURLs;
///Sets whether JavaScript running in the context of a file scheme URL should be allowed to access content from any origin.
///Note that this setting affects only JavaScript access to file scheme resources.
///This includes access to content from other file scheme URLs. The default value is `false`.
bool allowUniversalAccessFromFileURLs;
///Sets the path to the Application Caches files. In order for the Application Caches API to be enabled, this option must be set a path to which the application can write. ///Sets the path to the Application Caches files. In order for the Application Caches API to be enabled, this option must be set a path to which the application can write.
///This option is used one time: repeated calls are ignored. ///This option is used one time: repeated calls are ignored.
String? appCachePath; String? appCachePath;
...@@ -526,8 +544,6 @@ class AndroidInAppWebViewOptions ...@@ -526,8 +544,6 @@ class AndroidInAppWebViewOptions
this.mixedContentMode, this.mixedContentMode,
this.allowContentAccess = true, this.allowContentAccess = true,
this.allowFileAccess = true, this.allowFileAccess = true,
this.allowFileAccessFromFileURLs = false,
this.allowUniversalAccessFromFileURLs = false,
this.appCachePath, this.appCachePath,
this.blockNetworkImage = false, this.blockNetworkImage = false,
this.blockNetworkLoads = false, this.blockNetworkLoads = false,
...@@ -585,8 +601,6 @@ class AndroidInAppWebViewOptions ...@@ -585,8 +601,6 @@ class AndroidInAppWebViewOptions
"mixedContentMode": mixedContentMode?.toValue(), "mixedContentMode": mixedContentMode?.toValue(),
"allowContentAccess": allowContentAccess, "allowContentAccess": allowContentAccess,
"allowFileAccess": allowFileAccess, "allowFileAccess": allowFileAccess,
"allowFileAccessFromFileURLs": allowFileAccessFromFileURLs,
"allowUniversalAccessFromFileURLs": allowUniversalAccessFromFileURLs,
"appCachePath": appCachePath, "appCachePath": appCachePath,
"blockNetworkImage": blockNetworkImage, "blockNetworkImage": blockNetworkImage,
"blockNetworkLoads": blockNetworkLoads, "blockNetworkLoads": blockNetworkLoads,
...@@ -644,9 +658,6 @@ class AndroidInAppWebViewOptions ...@@ -644,9 +658,6 @@ class AndroidInAppWebViewOptions
AndroidMixedContentMode.fromValue(map["mixedContentMode"]); AndroidMixedContentMode.fromValue(map["mixedContentMode"]);
options.allowContentAccess = map["allowContentAccess"]; options.allowContentAccess = map["allowContentAccess"];
options.allowFileAccess = map["allowFileAccess"]; options.allowFileAccess = map["allowFileAccess"];
options.allowFileAccessFromFileURLs = map["allowFileAccessFromFileURLs"];
options.allowUniversalAccessFromFileURLs =
map["allowUniversalAccessFromFileURLs"];
options.appCachePath = map["appCachePath"]; options.appCachePath = map["appCachePath"];
options.blockNetworkImage = map["blockNetworkImage"]; options.blockNetworkImage = map["blockNetworkImage"];
options.blockNetworkLoads = map["blockNetworkLoads"]; options.blockNetworkLoads = map["blockNetworkLoads"];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment