- Merge "Fix abstract method error && swift version error" [#155](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/155)(thanks to [AlexVincent525](https://github.com/AlexVincent525))
- Merge "Fix abstract method error && swift version error" [#155](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/155)(thanks to [AlexVincent525](https://github.com/AlexVincent525))
- Merge "migrating to swift 5.0" [#162](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/162)(thanks to [fattiger00](https://github.com/fattiger00))
- Merge "migrating to swift 5.0" [#162](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/162)(thanks to [fattiger00](https://github.com/fattiger00))
- Merge "Update readme example" [#178](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/178)(thanks to [SebastienBtr](https://github.com/SebastienBtr))
- Merge "Update readme example" [#178](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/178)(thanks to [SebastienBtr](https://github.com/SebastienBtr))
- Merge "handle choose file callback in android" [#183](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/183)(thanks to [crazecoder](https://github.com/crazecoder))
- Merge "add initialScale in android" [#186](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/186)(thanks to [crazecoder](https://github.com/crazecoder))
- Added `horizontalScrollBarEnabled` and `verticalScrollBarEnabled` options to enable/disable the corresponding scrollbar of the WebView [#165](https://github.com/pichillilorenzo/flutter_inappbrowser/issues/165)
- Added `horizontalScrollBarEnabled` and `verticalScrollBarEnabled` options to enable/disable the corresponding scrollbar of the WebView [#165](https://github.com/pichillilorenzo/flutter_inappbrowser/issues/165)
- Added `onDownloadStart` event and `useOnDownloadStart` option: event fires when the WebView recognizes and starts a downloadable file.
- Added `onDownloadStart` event and `useOnDownloadStart` option: event fires when the WebView recognizes and starts a downloadable file.
- Added `onLoadResourceCustomScheme` event and `resourceCustomSchemes` option to set custom schemes that WebView must handle to load resources
- Added `onLoadResourceCustomScheme` event and `resourceCustomSchemes` option to set custom schemes that WebView must handle to load resources
///Give the host application a chance to take control when a URL is about to be loaded in the current WebView.
///Give the host application a chance to take control when a URL is about to be loaded in the current WebView.
///
///
///**NOTE**: In order to be able to listen this event, you need to set `useShouldOverrideUrlLoading` option to `true`.
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldOverrideUrlLoading] option to `true`.
voidshouldOverrideUrlLoading(Stringurl){
voidshouldOverrideUrlLoading(Stringurl){
}
}
///Event fires when the [InAppBrowser] webview loads a resource.
///Event fires when the [InAppBrowser] webview loads a resource.
///
///
///**NOTE**: In order to be able to listen this event, you need to set `useOnLoadResource` option to `true`.
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnLoadResource] and [InAppWebViewOptions.javaScriptEnabled] options to `true`.
voidonLoadResource(LoadedResourceresource){
voidonLoadResource(LoadedResourceresource){
}
}
...
@@ -386,6 +386,8 @@ class InAppBrowser {
...
@@ -386,6 +386,8 @@ class InAppBrowser {
///Event fires when [InAppBrowser] recognizes and starts a downloadable file.
///Event fires when [InAppBrowser] recognizes and starts a downloadable file.
///
///
///[url] represents the url of the file.
///[url] represents the url of the file.
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnDownloadStart] option to `true`.
voidonDownloadStart(Stringurl){
voidonDownloadStart(Stringurl){
}
}
...
@@ -402,6 +404,8 @@ class InAppBrowser {
...
@@ -402,6 +404,8 @@ class InAppBrowser {
///Event fires when the [InAppBrowser] webview tries to open a link with `target="_blank"`.
///Event fires when the [InAppBrowser] webview tries to open a link with `target="_blank"`.
///
///
///[url] represents the url of the link.
///[url] represents the url of the link.
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnTargetBlank] option to `true`.
voidonTargetBlank(Stringurl){
voidonTargetBlank(Stringurl){
}
}
...
@@ -454,19 +458,27 @@ class InAppBrowser {
...
@@ -454,19 +458,27 @@ class InAppBrowser {
}
}
///Event fires when a WebView received an HTTP authentication request. The default behavior is to cancel the request.
///Event fires when the WebView received an HTTP authentication request. The default behavior is to cancel the request.
///
///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the auth challenge.
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [HttpAuthChallenge].
/// - __builtInZoomControls__: Set to `true` if the WebView should use its built-in zoom mechanisms. The default value is `false`.
/// - __builtInZoomControls__: Set to `true` if the WebView should use its built-in zoom mechanisms. The default value is `false`.
/// - __displayZoomControls__: Set to `true` if the WebView should display on-screen zoom controls when using the built-in zoom mechanisms. The default value is `false`.
/// - __displayZoomControls__: Set to `true` if the WebView should display on-screen zoom controls when using the built-in zoom mechanisms. The default value is `false`.
/// - __supportZoom__: Set to `false` if the WebView should not support zooming using its on-screen zoom controls and gestures. The default value is `true`.
/// - __supportZoom__: Set to `false` if the WebView should not support zooming using its on-screen zoom controls and gestures. The default value is `true`.
/// - __databaseEnabled__: Set to `true` if you want injectScriptFilethe database storage API is enabled. The default value is `false`.
/// - __databaseEnabled__: Set to `true` if you want the database storage API is enabled. The default value is `false`.
/// - __domStorageEnabled__: Set to `true` if you want the DOM storage API is enabled. The default value is `false`.
/// - __domStorageEnabled__: Set to `true` if you want the DOM storage API is enabled. The default value is `false`.
/// - __useWideViewPort__: Set to `true` if the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is false, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is true and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. The default value is `true`.
/// - __useWideViewPort__: Set to `true` if the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is false, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is true and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. The default value is `true`.
/// - __safeBrowsingEnabled__: Set to `true` if you want the Safe Browsing is enabled. Safe Browsing allows WebView to protect against malware and phishing attacks by verifying the links. The default value is `true`.
/// - __safeBrowsingEnabled__: Set to `true` if you want the Safe Browsing is enabled. Safe Browsing allows WebView to protect against malware and phishing attacks by verifying the links. The default value is `true`.
...
@@ -81,14 +81,12 @@ class InAppWebView extends StatefulWidget {
...
@@ -81,14 +81,12 @@ class InAppWebView extends StatefulWidget {
///Give the host application a chance to take control when a URL is about to be loaded in the current WebView.
///Give the host application a chance to take control when a URL is about to be loaded in the current WebView.
///
///
///**NOTE**: In order to be able to listen this event, you need to set `useShouldOverrideUrlLoading` option to `true`.
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldOverrideUrlLoading] option to `true`.
///Event fires when the [InAppWebView] loads a resource.
///Event fires when the [InAppWebView] loads a resource.
///
///
///**NOTE**: In order to be able to listen this event, you need to set `useOnLoadResource` option to `true`.
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnLoadResource] and [InAppWebViewOptions.javaScriptEnabled] options to `true`.
///
///**NOTE only for Android**: to be able to listen this event, you need also the enable javascript.
///Event fires when the [InAppWebView] finds the `custom-scheme` while loading a resource. Here you can handle the url request and return a [CustomSchemeResponse] to load a specific resource encoded to `base64`.
///Event fires when the [InAppWebView] finds the `custom-scheme` while loading a resource. Here you can handle the url request and return a [CustomSchemeResponse] to load a specific resource encoded to `base64`.
...
@@ -113,6 +113,8 @@ class InAppWebView extends StatefulWidget {
...
@@ -113,6 +113,8 @@ class InAppWebView extends StatefulWidget {
///Event fires when the [InAppWebView] tries to open a link with `target="_blank"`.
///Event fires when the [InAppWebView] tries to open a link with `target="_blank"`.
///
///
///[url] represents the url of the link.
///[url] represents the url of the link.
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useOnTargetBlank] option to `true`.
///Event that notifies the host application that web content from the specified origin is attempting to use the Geolocation API, but no permission state is currently set for that origin.
///Event that notifies the host application that web content from the specified origin is attempting to use the Geolocation API, but no permission state is currently set for that origin.
...
@@ -154,15 +156,23 @@ class InAppWebView extends StatefulWidget {
...
@@ -154,15 +156,23 @@ class InAppWebView extends StatefulWidget {
///Set to `true` to be able to listen at the [shouldInterceptAjaxRequest] event. The default value is `false`.
booluseShouldInterceptAjaxRequest;
booluseShouldInterceptAjaxRequest;
///Set to `true` to be able to listen at the [shouldInterceptFetchRequest] event. The default value is `false`.
booluseShouldInterceptFetchRequest;
booluseShouldInterceptFetchRequest;
///Set to `true` to open a browser window with incognito mode. The default value is `false`.
///
///**NOTE**: available on iOS 9.0+.
boolincognito;
boolincognito;
///Sets whether WebView should use browser caching. The default value is `true`.
///
///**NOTE**: available on iOS 9.0+.
boolcacheEnabled;
boolcacheEnabled;
///Set to `true` to make the background of the WebView transparent. If your app has a dark theme, this can prevent a white flash on initialization. The default value is `false`.
///Enables or disables content URL access within WebView. Content URL access allows WebView to load content from a content provider installed in the system. The default value is `true`.
boolallowContentAccess;
boolallowContentAccess;
///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`.
boolallowFileAccess;
boolallowFileAccess;
///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`.
boolallowFileAccessFromFileURLs;
boolallowFileAccessFromFileURLs;
///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`.
boolallowUniversalAccessFromFileURLs;
boolallowUniversalAccessFromFileURLs;
///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.
StringappCachePath;
StringappCachePath;
///Sets whether the WebView should not load image resources from the network (resources accessed via http and https URI schemes). The default value is `false`.
boolblockNetworkImage;
boolblockNetworkImage;
///Sets whether the WebView should not load resources from the network. The default value is `false`.
boolblockNetworkLoads;
boolblockNetworkLoads;
///Overrides the way the cache is used. The way the cache is used is based on the navigation type. For a normal page load, the cache is checked and content is re-validated as needed.
///When navigating back, content is not revalidated, instead the content is just retrieved from the cache. The default value is [AndroidInAppWebViewCacheMode.LOAD_DEFAULT].
AndroidInAppWebViewCacheModecacheMode;
AndroidInAppWebViewCacheModecacheMode;
///Sets the cursive font family name. The default value is `"cursive"`.
StringcursiveFontFamily;
StringcursiveFontFamily;
///Sets the default fixed font size. The default value is `16`.
intdefaultFixedFontSize;
intdefaultFixedFontSize;
///Sets the default font size. The default value is `16`.
intdefaultFontSize;
intdefaultFontSize;
///Sets the default text encoding name to use when decoding html pages. The default value is `"UTF-8"`.
StringdefaultTextEncodingName;
StringdefaultTextEncodingName;
///Disables the action mode menu items according to menuItems flag.
///Sets whether the WebView loads pages in overview mode, that is, zooms out the content to fit on screen by width.
///This setting is taken into account when the content width is greater than the width of the WebView control, for example, when [useWideViewPort] is enabled.
///The default value is `false`.
boolloadWithOverviewMode;
boolloadWithOverviewMode;
///Sets whether the WebView should load image resources. Note that this method controls loading of all images, including those embedded using the data URI scheme.
///Note that if the value of this setting is changed from false to true, all images resources referenced by content currently displayed by the WebView are loaded automatically.
///The default value is `true`.
boolloadsImagesAutomatically;
boolloadsImagesAutomatically;
///Sets the minimum logical font size. The default is `8`.
intminimumLogicalFontSize;
intminimumLogicalFontSize;
///Sets the initial scale for this WebView. 0 means default.The behavior for the default scale depends on the state of [useWideViewPort] and [loadWithOverviewMode].
///If the content fits into the WebView control by width, then the zoom is set to 100%. For wide content, the behavior depends on the state of [loadWithOverviewMode].
///If its value is true, the content will be zoomed out to be fit by width into the WebView control, otherwise not.
///If initial scale is greater than 0, WebView starts with this value as initial scale.
///Please note that unlike the scale properties in the viewport meta tag, this method doesn't take the screen density into account.
///The default is `0`.
intinitialScale;
intinitialScale;
///Tells the WebView whether it needs to set a node. The default value is `true`.
boolneedInitialFocus;
boolneedInitialFocus;
///Sets whether this WebView should raster tiles when it is offscreen but attached to a window.
///Turning this on can avoid rendering artifacts when animating an offscreen WebView on-screen.
///Offscreen WebViews in this mode use more memory. The default value is `false`.
///
///**NOTE**: available on Android 23+.
booloffscreenPreRaster;
booloffscreenPreRaster;
///Sets the sans-serif font family name. The default value is `"sans-serif"`.
StringsansSerifFontFamily;
StringsansSerifFontFamily;
///Sets the serif font family name. The default value is `"sans-serif"`.
StringserifFontFamily;
StringserifFontFamily;
///Sets the standard font family name. The default value is `"sans-serif"`.
StringstandardFontFamily;
StringstandardFontFamily;
///Sets whether the WebView should save form data. In Android O, the platform has implemented a fully functional Autofill feature to store form data.
///Therefore, the Webview form data save feature is disabled. Note that the feature will continue to be supported on older versions of Android as before.
boolsaveFormData;
boolsaveFormData;
///Boolean value to enable third party cookies in the WebView.
///Used on Android Lollipop and above only as third party cookies are enabled by default on Android Kitkat and below and on iOS.
///The default value is `true`.
///
///**NOTE**: available on Android 21+.
boolthirdPartyCookiesEnabled;
boolthirdPartyCookiesEnabled;
///Boolean value to enable Hardware Acceleration in the WebView.