Commit bc6bed18 authored by Lorenzo Pichilli's avatar Lorenzo Pichilli

Added new WebView option minimumFontSize, Added new Android WebView options,...

Added new WebView option minimumFontSize, Added new Android WebView options, Added new iOS WebView options, Added onGeolocationPermissionsShowPrompt event and GeolocationPermissionShowPromptResponse class (available only for Android), updated Android ContentBlocker, updated Android build.gradle compileSdkVersion 29
parent 372b7712
This diff is collapsed.
## 1.3.0 ## 2.0.0
- Merge "Avoid null pointer exception after webview is disposed" [#116](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/116) (thanks to [robsonfingo](https://github.com/robsonfingo)) - Merge "Avoid null pointer exception after webview is disposed" [#116](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/116) (thanks to [robsonfingo](https://github.com/robsonfingo))
- Merge "Remove async call in close" [#119](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/119) (thanks to [benfingo](https://github.com/benfingo)) - Merge "Remove async call in close" [#119](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/119) (thanks to [benfingo](https://github.com/benfingo))
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
- 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
- Added `onTargetBlank` event and `useOnTargetBlank` option to manage links with `target="_blank"` - Added `onTargetBlank` event and `useOnTargetBlank` option to manage links with `target="_blank"`
- Added `ContentBlocker`, `ContentBlockerTrigger` and `ContentBlockerAction` classes and the `contentBlockers` option that allows to define a set of rules to use to block content in the WebView - Added `ContentBlocker`, `ContentBlockerTrigger` and `ContentBlockerAction` classes and the `contentBlockers` option that allows to define a set of rules to use to block content in the WebView
- Added new WebView option `minimumFontSize`
- Added new Android WebView options: `allowContentAccess`, `allowFileAccess`, `allowFileAccessFromFileURLs`, `allowUniversalAccessFromFileURLs`, `appCacheEnabled`, `appCachePath`, `blockNetworkImage`, `blockNetworkLoads`, `cacheMode`, `cursiveFontFamily`, `defaultFixedFontSize`, `defaultFontSize`, `defaultTextEncodingName`, `disabledActionModeMenuItems`, `fantasyFontFamily`, `fixedFontFamily`, `forceDark`, `geolocationEnabled`, `layoutAlgorithm`, `loadWithOverviewMode`, `loadsImagesAutomatically`, `minimumLogicalFontSize`, `needInitialFocus`, `offscreenPreRaster`, `sansSerifFontFamily`, `serifFontFamily`, `standardFontFamily`
- Added new iOS WebView options: `applicationNameForUserAgent`, `isFraudulentWebsiteWarningEnabled`, `selectionGranularity`, `dataDetectorTypes`, `preferredContentMode`
- Added `onGeolocationPermissionsShowPrompt` event and `GeolocationPermissionShowPromptResponse` class (available only for Android)
### BREAKING CHANGES ### BREAKING CHANGES
- Deleted `WebResourceRequest` class - Deleted `WebResourceRequest` class
...@@ -20,7 +24,6 @@ ...@@ -20,7 +24,6 @@
- Updated `onLoadResource` event - Updated `onLoadResource` event
- WebView options are now available with the new corresponding classes: `InAppWebViewOptions`, `AndroidInAppWebViewOptions`, `iOSInAppWebViewOptions`, `InAppBrowserOptions`, `AndroidInAppBrowserOptions`, `iOSInAppBrowserOptions`, `AndroidChromeCustomTabsOptions` and `iOSChromeCustomTabsOptions` - WebView options are now available with the new corresponding classes: `InAppWebViewOptions`, `AndroidInAppWebViewOptions`, `iOSInAppWebViewOptions`, `InAppBrowserOptions`, `AndroidInAppBrowserOptions`, `iOSInAppBrowserOptions`, `AndroidChromeCustomTabsOptions` and `iOSChromeCustomTabsOptions`
## 1.2.1 ## 1.2.1
- Merge "Add new option to control the contentMode in Android platform" [#101](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/101) (thanks to [DreamBuddy](https://github.com/DreamBuddy)) - Merge "Add new option to control the contentMode in Android platform" [#101](https://github.com/pichillilorenzo/flutter_inappbrowser/pull/101) (thanks to [DreamBuddy](https://github.com/DreamBuddy))
......
...@@ -35,7 +35,7 @@ rootProject.allprojects { ...@@ -35,7 +35,7 @@ rootProject.allprojects {
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
android { android {
compileSdkVersion 28 compileSdkVersion 29
defaultConfig { defaultConfig {
minSdkVersion 17 minSdkVersion 17
......
...@@ -3,10 +3,12 @@ package com.pichillilorenzo.flutter_inappbrowser.ContentBlocker; ...@@ -3,10 +3,12 @@ package com.pichillilorenzo.flutter_inappbrowser.ContentBlocker;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Pattern;
public class ContentBlockerTrigger { public class ContentBlockerTrigger {
public String urlFilter; public String urlFilter;
public Pattern urlFilterPatternCompiled;
public Boolean urlFilterIsCaseSensitive; public Boolean urlFilterIsCaseSensitive;
public List<ContentBlockerTriggerResourceType> resourceType = new ArrayList<>(); public List<ContentBlockerTriggerResourceType> resourceType = new ArrayList<>();
public List<String> ifDomain = new ArrayList<>(); public List<String> ifDomain = new ArrayList<>();
...@@ -18,6 +20,8 @@ public class ContentBlockerTrigger { ...@@ -18,6 +20,8 @@ public class ContentBlockerTrigger {
public ContentBlockerTrigger(String urlFilter, Boolean urlFilterIsCaseSensitive, List<ContentBlockerTriggerResourceType> resourceType, List<String> ifDomain, public ContentBlockerTrigger(String urlFilter, Boolean urlFilterIsCaseSensitive, List<ContentBlockerTriggerResourceType> resourceType, List<String> ifDomain,
List<String> unlessDomain, List<String> loadType, List<String> ifTopUrl, List<String> unlessTopUrl) { List<String> unlessDomain, List<String> loadType, List<String> ifTopUrl, List<String> unlessTopUrl) {
this.urlFilter = urlFilter; this.urlFilter = urlFilter;
this.urlFilterPatternCompiled = Pattern.compile(this.urlFilter);
this.resourceType = resourceType != null ? resourceType : this.resourceType; this.resourceType = resourceType != null ? resourceType : this.resourceType;
this.urlFilterIsCaseSensitive = urlFilterIsCaseSensitive != null ? urlFilterIsCaseSensitive : false; this.urlFilterIsCaseSensitive = urlFilterIsCaseSensitive != null ? urlFilterIsCaseSensitive : false;
this.ifDomain = ifDomain != null ? ifDomain : this.ifDomain; this.ifDomain = ifDomain != null ? ifDomain : this.ifDomain;
......
package com.pichillilorenzo.flutter_inappbrowser; package com.pichillilorenzo.flutter_inappbrowser;
import android.Manifest;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.util.Log; import android.util.Log;
...@@ -191,7 +192,10 @@ public class FlutterWebView implements PlatformView, MethodCallHandler { ...@@ -191,7 +192,10 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
result.success((webView != null) && webView.isLoading()); result.success((webView != null) && webView.isLoading());
break; break;
case "takeScreenshot": case "takeScreenshot":
result.success((webView != null) ? webView.takeScreenshot() : null); if (webView != null)
webView.takeScreenshot(result);
else
result.error(LOG_TAG, "webView is null", null);
break; break;
case "setOptions": case "setOptions":
if (webView != null) { if (webView != null) {
......
package com.pichillilorenzo.flutter_inappbrowser.InAppWebView; package com.pichillilorenzo.flutter_inappbrowser.InAppWebView;
import android.Manifest;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
...@@ -9,6 +11,7 @@ import android.os.Build; ...@@ -9,6 +11,7 @@ import android.os.Build;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.webkit.ConsoleMessage; import android.webkit.ConsoleMessage;
import android.webkit.GeolocationPermissions;
import android.webkit.ValueCallback; import android.webkit.ValueCallback;
import android.webkit.WebChromeClient; import android.webkit.WebChromeClient;
import android.webkit.WebView; import android.webkit.WebView;
...@@ -17,6 +20,7 @@ import android.widget.FrameLayout; ...@@ -17,6 +20,7 @@ import android.widget.FrameLayout;
import com.pichillilorenzo.flutter_inappbrowser.FlutterWebView; import com.pichillilorenzo.flutter_inappbrowser.FlutterWebView;
import com.pichillilorenzo.flutter_inappbrowser.InAppBrowserActivity; import com.pichillilorenzo.flutter_inappbrowser.InAppBrowserActivity;
import com.pichillilorenzo.flutter_inappbrowser.InAppBrowserFlutterPlugin; import com.pichillilorenzo.flutter_inappbrowser.InAppBrowserFlutterPlugin;
import com.pichillilorenzo.flutter_inappbrowser.RequestPermissionHandler;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -98,6 +102,34 @@ public class InAppWebChromeClient extends WebChromeClient { ...@@ -98,6 +102,34 @@ public class InAppWebChromeClient extends WebChromeClient {
return false; return false;
} }
@Override
public void onGeolocationPermissionsShowPrompt (final String origin, final GeolocationPermissions.Callback callback) {
Map<String, Object> obj = new HashMap<>();
if (inAppBrowserActivity != null)
obj.put("uuid", inAppBrowserActivity.uuid);
obj.put("origin", origin);
getChannel().invokeMethod("onGeolocationPermissionsShowPrompt", obj, new MethodChannel.Result() {
@Override
public void success(Object o) {
Map<String, Object> response = (Map<String, Object>) o;
if (response != null)
callback.invoke((String) response.get("origin"),(Boolean) response.get("allow"),(Boolean) response.get("retain"));
else
callback.invoke(origin,false,false);
}
@Override
public void error(String s, String s1, Object o) {
callback.invoke(origin,false,false);
}
@Override
public void notImplemented() {
callback.invoke(origin,false,false);
}
});
}
@Override @Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) { public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
Map<String, Object> obj = new HashMap<>(); Map<String, Object> obj = new HashMap<>();
......
...@@ -335,7 +335,7 @@ public class InAppWebViewClient extends WebViewClient { ...@@ -335,7 +335,7 @@ public class InAppWebViewClient extends WebViewClient {
Map<String, String> res = (Map<String, String>) flutterResult.result; Map<String, String> res = (Map<String, String>) flutterResult.result;
WebResourceResponse response = null; WebResourceResponse response = null;
try { try {
response = ContentBlocker.checkUrl(webView, url, res.get("content-type")); response = webView.contentBlockerHandler.checkUrl(webView, url, res.get("content-type"));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
Log.e(LOG_TAG, e.getMessage()); Log.e(LOG_TAG, e.getMessage());
...@@ -349,7 +349,7 @@ public class InAppWebViewClient extends WebViewClient { ...@@ -349,7 +349,7 @@ public class InAppWebViewClient extends WebViewClient {
WebResourceResponse response = null; WebResourceResponse response = null;
try { try {
response = ContentBlocker.checkUrl(webView, url); response = webView.contentBlockerHandler.checkUrl(webView, url);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
Log.e(LOG_TAG, e.getMessage()); Log.e(LOG_TAG, e.getMessage());
......
package com.pichillilorenzo.flutter_inappbrowser.InAppWebView; package com.pichillilorenzo.flutter_inappbrowser.InAppWebView;
import android.webkit.WebSettings;
import com.pichillilorenzo.flutter_inappbrowser.Options; import com.pichillilorenzo.flutter_inappbrowser.Options;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -19,11 +21,12 @@ public class InAppWebViewOptions extends Options { ...@@ -19,11 +21,12 @@ public class InAppWebViewOptions extends Options {
public boolean javaScriptEnabled = true; public boolean javaScriptEnabled = true;
public boolean javaScriptCanOpenWindowsAutomatically = false; public boolean javaScriptCanOpenWindowsAutomatically = false;
public boolean mediaPlaybackRequiresUserGesture = true; public boolean mediaPlaybackRequiresUserGesture = true;
public int textZoom = 100; public Integer textZoom = 100;
public boolean verticalScrollBarEnabled = true; public boolean verticalScrollBarEnabled = true;
public boolean horizontalScrollBarEnabled = true; public boolean horizontalScrollBarEnabled = true;
public List<String> resourceCustomSchemes = new ArrayList<>(); public List<String> resourceCustomSchemes = new ArrayList<>();
public List<Map<String, Map<String, Object>>> contentBlockers = new ArrayList<>(); public List<Map<String, Map<String, Object>>> contentBlockers = new ArrayList<>();
public Integer minimumFontSize = 8;
public boolean clearSessionCache = false; public boolean clearSessionCache = false;
public boolean builtInZoomControls = false; public boolean builtInZoomControls = false;
...@@ -34,5 +37,32 @@ public class InAppWebViewOptions extends Options { ...@@ -34,5 +37,32 @@ public class InAppWebViewOptions extends Options {
public boolean useWideViewPort = true; public boolean useWideViewPort = true;
public boolean safeBrowsingEnabled = true; public boolean safeBrowsingEnabled = true;
public boolean transparentBackground = false; public boolean transparentBackground = false;
public String mixedContentMode = ""; public Integer mixedContentMode;
public boolean allowContentAccess = true;
public boolean allowFileAccess = true;
public boolean allowFileAccessFromFileURLs = true;
public boolean allowUniversalAccessFromFileURLs = true;
public boolean appCacheEnabled = true;
public String appCachePath;
public boolean blockNetworkImage = false;
public boolean blockNetworkLoads = false;
public Integer cacheMode = WebSettings.LOAD_DEFAULT;
public String cursiveFontFamily = "cursive";
public Integer defaultFixedFontSize = 16;
public Integer defaultFontSize = 16;
public String defaultTextEncodingName = "UTF-8";
public Integer disabledActionModeMenuItems;
public String fantasyFontFamily = "fantasy";
public String fixedFontFamily = "monospace";
public Integer forceDark = 0; // WebSettings.FORCE_DARK_OFF
public boolean geolocationEnabled = true;
public WebSettings.LayoutAlgorithm layoutAlgorithm;
public boolean loadWithOverviewMode = true;
public boolean loadsImagesAutomatically = true;
public Integer minimumLogicalFontSize = 8;
public boolean needInitialFocus = true;
public boolean offscreenPreRaster = false;
public String sansSerifFontFamily = "sans-serif";
public String serifFontFamily = "sans-serif";
public String standardFontFamily = "sans-serif";
} }
...@@ -2,6 +2,8 @@ package com.pichillilorenzo.flutter_inappbrowser; ...@@ -2,6 +2,8 @@ package com.pichillilorenzo.flutter_inappbrowser;
import android.app.Activity; import android.app.Activity;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
...@@ -15,8 +17,6 @@ public abstract class RequestPermissionHandler implements ActivityCompat.OnReque ...@@ -15,8 +17,6 @@ public abstract class RequestPermissionHandler implements ActivityCompat.OnReque
private static Map<Integer, List<Runnable>> actionDictionary = new HashMap<>(); private static Map<Integer, List<Runnable>> actionDictionary = new HashMap<>();
public static int REQUEST_CODE_WRITE_EXTERNAL_STORAGE = 1;
public static void checkAndRun(Activity activity, String permission, int requestCode, Runnable runnable) { public static void checkAndRun(Activity activity, String permission, int requestCode, Runnable runnable) {
int permissionCheck = ContextCompat.checkSelfPermission(activity.getApplicationContext(), permission); int permissionCheck = ContextCompat.checkSelfPermission(activity.getApplicationContext(), permission);
...@@ -34,6 +34,7 @@ public abstract class RequestPermissionHandler implements ActivityCompat.OnReque ...@@ -34,6 +34,7 @@ public abstract class RequestPermissionHandler implements ActivityCompat.OnReque
@Override @Override
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) { public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) {
Log.d("asdasd", "\n\na asd asd \n\n");
if ((grantResults.length > 0) && (grantResults[0] == PackageManager.PERMISSION_GRANTED)) { if ((grantResults.length > 0) && (grantResults[0] == PackageManager.PERMISSION_GRANTED)) {
List<Runnable> callbacks = actionDictionary.get(requestCode); List<Runnable> callbacks = actionDictionary.get(requestCode);
for (Runnable runnable : callbacks) { for (Runnable runnable : callbacks) {
......
...@@ -91,6 +91,5 @@ public class Util { ...@@ -91,6 +91,5 @@ public class Util {
result = r; result = r;
error = e; error = e;
} }
} }
} }
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
<!-- io.flutter.app.FlutterApplication is an android.app.Application that <!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method. calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide In most cases you can leave this as-is, but you if you want to provide
......
...@@ -56,6 +56,15 @@ ...@@ -56,6 +56,15 @@
}); });
$(document).ready(function() { $(document).ready(function() {
console.log("jQuery ready"); console.log("jQuery ready");
if ("geolocation" in navigator) {
console.log("Geolocation API enabled");
navigator.geolocation.getCurrentPosition(function(position) {
console.log(position.coords.latitude, position.coords.longitude);
});
} else {
console.log("No geolocation API");
}
}); });
</script> </script>
</body> </body>
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
97C146E61CF9000F007C117D /* Project object */ = { 97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1000; LastUpgradeCheck = 1110;
ORGANIZATIONNAME = "The Chromium Authors"; ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
...@@ -337,6 +337,7 @@ ...@@ -337,6 +337,7 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
...@@ -384,6 +385,7 @@ ...@@ -384,6 +385,7 @@
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
...@@ -393,6 +395,7 @@ ...@@ -393,6 +395,7 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
...@@ -434,6 +437,7 @@ ...@@ -434,6 +437,7 @@
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1000" LastUpgradeVersion = "1110"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion> <MacroExpansion>
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
...@@ -38,8 +36,8 @@ ...@@ -38,8 +36,8 @@
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
<AdditionalOptions> <Testables>
</AdditionalOptions> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug" buildConfiguration = "Debug"
...@@ -61,8 +59,6 @@ ...@@ -61,8 +59,6 @@
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Release" buildConfiguration = "Release"
......
...@@ -4,5 +4,7 @@ ...@@ -4,5 +4,7 @@
<dict> <dict>
<key>BuildSystemType</key> <key>BuildSystemType</key>
<string>Original</string> <string>Original</string>
<key>PreviewsEnabled</key>
<false/>
</dict> </dict>
</plist> </plist>
import UIKit import UIKit
import Flutter import Flutter
import flutter_downloader //import flutter_downloader
@UIApplicationMain @UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate {
...@@ -10,9 +10,9 @@ import flutter_downloader ...@@ -10,9 +10,9 @@ import flutter_downloader
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
GeneratedPluginRegistrant.register(with: self) GeneratedPluginRegistrant.register(with: self)
FlutterDownloaderPlugin.setPluginRegistrantCallback({(registry: FlutterPluginRegistry) in /*FlutterDownloaderPlugin.setPluginRegistrantCallback({(registry: FlutterPluginRegistry) in
}) })*/
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }
} }
...@@ -2,48 +2,54 @@ ...@@ -2,48 +2,54 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key></key> <key>NSLocationAlwaysUsageDescription</key>
<string></string> <string>Need location</string>
<key>CFBundleDevelopmentRegion</key> <key>NSLocationWhenInUseUsageDescription</key>
<string>en</string> <string>Need location</string>
<key>CFBundleExecutable</key> <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>$(EXECUTABLE_NAME)</string> <string>Need location</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>flutter_inappbrowser_example</string> <string>flutter_inappbrowser_example</string>
<key>CFBundlePackageType</key> <key>CFBundleInfoDictionaryVersion</key>
<string>APPL</string> <string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>
<array> <array>
<string>fetch</string> <string>fetch</string>
<string>remote-notification</string> <string>remote-notification</string>
</array> </array>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
<string>Main</string> <string>Main</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>io.flutter.embedded_views_preview</key>
<true/>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
...@@ -51,9 +57,7 @@ ...@@ -51,9 +57,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>CFBundleShortVersionString</key>
<false/> <string>$(FLUTTER_BUILD_NAME)</string>
<key>io.flutter.embedded_views_preview</key>
<true/>
</dict> </dict>
</plist> </plist>
...@@ -80,6 +80,16 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> { ...@@ -80,6 +80,16 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> {
ContentBlockerAction(ContentBlockerActionType.BLOCK) ContentBlockerAction(ContentBlockerActionType.BLOCK)
) )
] ]
),
AndroidInAppWebViewOptions(
databaseEnabled: true,
appCacheEnabled: true,
domStorageEnabled: true,
geolocationEnabled: true,
//blockNetworkImage: true,
),
iOSInAppWebViewOptions(
preferredContentMode: iOSInAppWebViewUserPreferredContentMode.DESKTOP
) )
], ],
onWebViewCreated: (InAppWebViewController controller) { onWebViewCreated: (InAppWebViewController controller) {
...@@ -103,6 +113,9 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> { ...@@ -103,6 +113,9 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> {
onLoadStop: (InAppWebViewController controller, String url) async { onLoadStop: (InAppWebViewController controller, String url) async {
print("stopped $url"); print("stopped $url");
}, },
onLoadError: (InAppWebViewController controller, String url, int code, String message) async {
print("error $url: $code, $message");
},
onProgressChanged: onProgressChanged:
(InAppWebViewController controller, int progress) { (InAppWebViewController controller, int progress) {
setState(() { setState(() {
...@@ -131,12 +144,12 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> { ...@@ -131,12 +144,12 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> {
"""); """);
}, },
onDownloadStart: (InAppWebViewController controller, String url) async { onDownloadStart: (InAppWebViewController controller, String url) async {
final taskId = await FlutterDownloader.enqueue( /*final taskId = await FlutterDownloader.enqueue(
url: url, url: url,
savedDir: await _findLocalPath(), savedDir: await _findLocalPath(),
showNotification: true, // show download progress in status bar (for Android) showNotification: true, // show download progress in status bar (for Android)
openFileFromNotification: true, // click on notification to open downloaded file (for Android) openFileFromNotification: true, // click on notification to open downloaded file (for Android)
); );*/
}, },
onLoadResourceCustomScheme: (InAppWebViewController controller, String scheme, String url) async { onLoadResourceCustomScheme: (InAppWebViewController controller, String scheme, String url) async {
if (scheme == "my-special-custom-scheme") { if (scheme == "my-special-custom-scheme") {
...@@ -151,6 +164,37 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> { ...@@ -151,6 +164,37 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> {
print("target _blank: " + url); print("target _blank: " + url);
controller.loadUrl(url); controller.loadUrl(url);
}, },
onGeolocationPermissionsShowPrompt: (InAppWebViewController controller, String origin) async {
GeolocationPermissionShowPromptResponse response;
await showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text("Permission Geolocation API"),
content: new Text("Can we use Geolocation API?"),
actions: <Widget>[
new FlatButton(
child: new Text("Close"),
onPressed: () {
response = new GeolocationPermissionShowPromptResponse(origin, false, false);
Navigator.of(context).pop();
},
),
new FlatButton(
child: new Text("Accept"),
onPressed: () {
response = new GeolocationPermissionShowPromptResponse(origin, true, true);
Navigator.of(context).pop();
},
),
],
);
},
);
return response;
}
), ),
), ),
), ),
......
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'package:flutter_inappbrowser_example/chrome_safari_example.screen.dart'; import 'package:flutter_inappbrowser_example/chrome_safari_example.screen.dart';
import 'package:flutter_inappbrowser_example/inline_example.screen.dart'; import 'package:flutter_inappbrowser_example/inline_example.screen.dart';
import 'package:flutter_inappbrowser_example/webview_example.screen.dart'; import 'package:flutter_inappbrowser_example/webview_example.screen.dart';
import 'package:flutter_downloader/flutter_downloader.dart'; import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:permission_handler/permission_handler.dart';
// InAppLocalhostServer localhostServer = new InAppLocalhostServer(); // InAppLocalhostServer localhostServer = new InAppLocalhostServer();
Future main() async { Future main() async {
// await localhostServer.start(); // await localhostServer.start();
await FlutterDownloader.initialize(); // await FlutterDownloader.initialize();
await PermissionHandler().requestPermissions([PermissionGroup.locationAlways]);
runApp(new MyApp()); runApp(new MyApp());
} }
......
...@@ -76,6 +76,11 @@ class MyInappBrowser extends InAppBrowser { ...@@ -76,6 +76,11 @@ class MyInappBrowser extends InAppBrowser {
Future<CustomSchemeResponse> onLoadResourceCustomScheme(String scheme, String url) async { Future<CustomSchemeResponse> onLoadResourceCustomScheme(String scheme, String url) async {
print("custom scheme: " + scheme); print("custom scheme: " + scheme);
} }
@override
Future<GeolocationPermissionShowPromptResponse> onGeolocationPermissionsShowPrompt(String origin) async {
print("request Geolocation permission API");
}
} }
class WebviewExampleScreen extends StatefulWidget { class WebviewExampleScreen extends StatefulWidget {
......
...@@ -21,6 +21,7 @@ dependencies: ...@@ -21,6 +21,7 @@ dependencies:
cupertino_icons: ^0.1.2 cupertino_icons: ^0.1.2
flutter_downloader: ^1.3.2 flutter_downloader: ^1.3.2
path_provider: ^1.4.0 path_provider: ^1.4.0
permission_handler: ^3.3.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
......
...@@ -39,7 +39,8 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView { ...@@ -39,7 +39,8 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView {
webView!.prepare() webView!.prepare()
if #available(iOS 11.0, *) { if #available(iOS 11.0, *) {
if let contentBlockers = webView!.options?.contentBlockers { self.webView!.configuration.userContentController.removeAllContentRuleLists()
if let contentBlockers = webView!.options?.contentBlockers, contentBlockers.count > 0 {
do { do {
let jsonData = try JSONSerialization.data(withJSONObject: contentBlockers, options: []) let jsonData = try JSONSerialization.data(withJSONObject: contentBlockers, options: [])
let blockRules = String(data: jsonData, encoding: String.Encoding.utf8) let blockRules = String(data: jsonData, encoding: String.Encoding.utf8)
......
This diff is collapsed.
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import WebKit
@objcMembers @objcMembers
public class InAppWebViewOptions: Options { public class InAppWebViewOptions: Options {
...@@ -23,6 +24,7 @@ public class InAppWebViewOptions: Options { ...@@ -23,6 +24,7 @@ public class InAppWebViewOptions: Options {
var horizontalScrollBarEnabled = true var horizontalScrollBarEnabled = true
var resourceCustomSchemes: [String] = [] var resourceCustomSchemes: [String] = []
var contentBlockers: [[String: [String : Any]]] = [] var contentBlockers: [[String: [String : Any]]] = []
var minimumFontSize = 0;
var disallowOverScroll = false var disallowOverScroll = false
var enableViewportScale = false var enableViewportScale = false
...@@ -35,6 +37,11 @@ public class InAppWebViewOptions: Options { ...@@ -35,6 +37,11 @@ public class InAppWebViewOptions: Options {
var allowsInlineMediaPlayback = false var allowsInlineMediaPlayback = false
var allowsPictureInPictureMediaPlayback = true var allowsPictureInPictureMediaPlayback = true
var transparentBackground = false var transparentBackground = false
var applicationNameForUserAgent = "";
var isFraudulentWebsiteWarningEnabled = true;
var selectionGranularity = 0;
var dataDetectorTypes: [String] = ["NONE"]; // WKDataDetectorTypeNone
var preferredContentMode = 0;
override init(){ override init(){
super.init() super.init()
......
...@@ -15,7 +15,7 @@ class ContentBlocker { ...@@ -15,7 +15,7 @@ class ContentBlocker {
class ContentBlockerTriggerResourceType { class ContentBlockerTriggerResourceType {
final String _value; final String _value;
const ContentBlockerTriggerResourceType._internal(this._value); const ContentBlockerTriggerResourceType._internal(this._value);
toString() => _value; toValue() => _value;
static const DOCUMENT = const ContentBlockerTriggerResourceType._internal('document'); static const DOCUMENT = const ContentBlockerTriggerResourceType._internal('document');
static const IMAGE = const ContentBlockerTriggerResourceType._internal('image'); static const IMAGE = const ContentBlockerTriggerResourceType._internal('image');
...@@ -30,7 +30,7 @@ class ContentBlockerTriggerResourceType { ...@@ -30,7 +30,7 @@ class ContentBlockerTriggerResourceType {
class ContentBlockerTriggerLoadType { class ContentBlockerTriggerLoadType {
final String _value; final String _value;
const ContentBlockerTriggerLoadType._internal(this._value); const ContentBlockerTriggerLoadType._internal(this._value);
toString() => _value; toValue() => _value;
static const FIRST_PARTY = const ContentBlockerTriggerLoadType._internal('first-party'); static const FIRST_PARTY = const ContentBlockerTriggerLoadType._internal('first-party');
static const THIRD_PARTY = const ContentBlockerTriggerLoadType._internal('third-party'); static const THIRD_PARTY = const ContentBlockerTriggerLoadType._internal('third-party');
...@@ -65,11 +65,11 @@ class ContentBlockerTrigger { ...@@ -65,11 +65,11 @@ class ContentBlockerTrigger {
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
List<String> resourceTypeStringList = []; List<String> resourceTypeStringList = [];
resourceType.forEach((type) { resourceType.forEach((type) {
resourceTypeStringList.add(type.toString()); resourceTypeStringList.add(type.toValue());
}); });
List<String> loadTypeStringList = []; List<String> loadTypeStringList = [];
loadType.forEach((type) { loadType.forEach((type) {
loadTypeStringList.add(type.toString()); loadTypeStringList.add(type.toValue());
}); });
Map<String, dynamic> map = { Map<String, dynamic> map = {
...@@ -95,7 +95,7 @@ class ContentBlockerTrigger { ...@@ -95,7 +95,7 @@ class ContentBlockerTrigger {
class ContentBlockerActionType { class ContentBlockerActionType {
final String _value; final String _value;
const ContentBlockerActionType._internal(this._value); const ContentBlockerActionType._internal(this._value);
toString() => _value; toValue() => _value;
static const BLOCK = const ContentBlockerActionType._internal('block'); static const BLOCK = const ContentBlockerActionType._internal('block');
static const CSS_DISPLAY_NONE = const ContentBlockerActionType._internal('css-display-none'); static const CSS_DISPLAY_NONE = const ContentBlockerActionType._internal('css-display-none');
...@@ -116,7 +116,7 @@ class ContentBlockerAction { ...@@ -116,7 +116,7 @@ class ContentBlockerAction {
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
Map<String, dynamic> map = { Map<String, dynamic> map = {
"type": type.toString(), "type": type.toValue(),
"selector": selector "selector": selector
}; };
......
...@@ -342,7 +342,7 @@ class InAppBrowser { ...@@ -342,7 +342,7 @@ class InAppBrowser {
///Event fires when the [InAppBrowser] webview 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 [InAppBrowser] webview 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`.
///[scheme] represents the scheme of the url. ///[scheme] represents the scheme of the url.
///[url] represents the url of the request. ///[url] represents the url of the request.
Future<CustomSchemeResponse> onLoadResourceCustomScheme(String scheme, String url) async { Future<CustomSchemeResponse> onLoadResourceCustomScheme(String scheme, String url) {
} }
...@@ -352,6 +352,15 @@ class InAppBrowser { ...@@ -352,6 +352,15 @@ class InAppBrowser {
} }
///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.
///Note that for applications targeting Android N and later SDKs (API level > `Build.VERSION_CODES.M`) this method is only called for requests originating from secure origins such as https.
///On non-secure origins geolocation requests are automatically denied.
///[origin] represents the origin of the web content attempting to use the Geolocation API.
///**NOTE**: available only for Android.
Future<GeolocationPermissionShowPromptResponse> onGeolocationPermissionsShowPrompt (String origin) {
}
void throwIsAlreadyOpened({String message = ''}) { void throwIsAlreadyOpened({String message = ''}) {
if (this.isOpened()) { if (this.isOpened()) {
throw Exception(['Error: ${ (message.isEmpty) ? '' : message + ' '}The browser is already opened.']); throw Exception(['Error: ${ (message.isEmpty) ? '' : message + ' '}The browser is already opened.']);
......
...@@ -128,6 +128,13 @@ class InAppWebView extends StatefulWidget { ...@@ -128,6 +128,13 @@ class InAppWebView extends StatefulWidget {
///[url] represents the url of the link. ///[url] represents the url of the link.
final onTargetBlankCallback onTargetBlank; final onTargetBlankCallback onTargetBlank;
///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.
///Note that for applications targeting Android N and later SDKs (API level > `Build.VERSION_CODES.M`) this method is only called for requests originating from secure origins such as https.
///On non-secure origins geolocation requests are automatically denied.
///[origin] represents the origin of the web content attempting to use the Geolocation API.
///**NOTE**: available only for Android.
final onGeolocationPermissionsShowPromptCallback onGeolocationPermissionsShowPrompt;
///Initial url that will be loaded. ///Initial url that will be loaded.
final String initialUrl; final String initialUrl;
///Initial asset file that will be loaded. See [InAppWebView.loadFile()] for explanation. ///Initial asset file that will be loaded. See [InAppWebView.loadFile()] for explanation.
...@@ -166,6 +173,7 @@ class InAppWebView extends StatefulWidget { ...@@ -166,6 +173,7 @@ class InAppWebView extends StatefulWidget {
this.onDownloadStart, this.onDownloadStart,
this.onLoadResourceCustomScheme, this.onLoadResourceCustomScheme,
this.onTargetBlank, this.onTargetBlank,
this.onGeolocationPermissionsShowPrompt,
this.gestureRecognizers, this.gestureRecognizers,
}) : super(key: key); }) : super(key: key);
...@@ -384,6 +392,13 @@ class InAppWebViewController { ...@@ -384,6 +392,13 @@ class InAppWebViewController {
else if (_inAppBrowser != null) else if (_inAppBrowser != null)
_inAppBrowser.onTargetBlank(url); _inAppBrowser.onTargetBlank(url);
break; break;
case "onGeolocationPermissionsShowPrompt":
String origin = call.arguments["origin"];
if (_widget != null && _widget.onGeolocationPermissionsShowPrompt != null)
return (await _widget.onGeolocationPermissionsShowPrompt(this, origin)).toMap();
else if (_inAppBrowser != null)
return (await _inAppBrowser.onGeolocationPermissionsShowPrompt(origin)).toMap();
break;
case "onCallJsHandler": case "onCallJsHandler":
String handlerName = call.arguments["handlerName"]; String handlerName = call.arguments["handlerName"];
// decode args to json // decode args to json
......
import 'dart:typed_data';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'in_app_webview.dart' show InAppWebViewController; import 'in_app_webview.dart' show InAppWebViewController;
...@@ -108,6 +106,28 @@ class WebHistoryItem { ...@@ -108,6 +106,28 @@ class WebHistoryItem {
WebHistoryItem(this.originalUrl, this.title, this.url, this.index, this.offset); WebHistoryItem(this.originalUrl, this.title, this.url, this.index, this.offset);
} }
///GeolocationPermissionPromptResponse class.
///
///Class used by the host application to set the Geolocation permission state for an origin during the [onGeolocationPermissionsShowPrompt] event.
class GeolocationPermissionShowPromptResponse {
///The origin for which permissions are set.
String origin;
///Whether or not the origin should be allowed to use the Geolocation API.
bool allow;
///Whether the permission should be retained beyond the lifetime of a page currently being displayed by a WebView
bool retain;
GeolocationPermissionShowPromptResponse(this.origin, this.allow, this.retain);
Map<String, dynamic> toMap() {
return {
"origin": origin,
"allow": allow,
"retain": retain
};
}
}
typedef onWebViewCreatedCallback = void Function(InAppWebViewController controller); typedef onWebViewCreatedCallback = void Function(InAppWebViewController controller);
typedef onWebViewLoadStartCallback = void Function(InAppWebViewController controller, String url); typedef onWebViewLoadStartCallback = void Function(InAppWebViewController controller, String url);
typedef onWebViewLoadStopCallback = void Function(InAppWebViewController controller, String url); typedef onWebViewLoadStopCallback = void Function(InAppWebViewController controller, String url);
...@@ -119,4 +139,5 @@ typedef onWebViewLoadResourceCallback = void Function(InAppWebViewController con ...@@ -119,4 +139,5 @@ typedef onWebViewLoadResourceCallback = void Function(InAppWebViewController con
typedef onWebViewScrollChangedCallback = void Function(InAppWebViewController controller, int x, int y); typedef onWebViewScrollChangedCallback = void Function(InAppWebViewController controller, int x, int y);
typedef onDownloadStartCallback = void Function(InAppWebViewController controller, String url); typedef onDownloadStartCallback = void Function(InAppWebViewController controller, String url);
typedef onLoadResourceCustomSchemeCallback = Future<CustomSchemeResponse> Function(InAppWebViewController controller, String scheme, String url); typedef onLoadResourceCustomSchemeCallback = Future<CustomSchemeResponse> Function(InAppWebViewController controller, String scheme, String url);
typedef onTargetBlankCallback = void Function(InAppWebViewController controller, String url); typedef onTargetBlankCallback = void Function(InAppWebViewController controller, String url);
\ No newline at end of file typedef onGeolocationPermissionsShowPromptCallback = Future<GeolocationPermissionShowPromptResponse> Function(InAppWebViewController controller, String origin);
\ No newline at end of file
This diff is collapsed.
name: flutter_inappbrowser name: flutter_inappbrowser
description: A Flutter plugin that allows you to add an inline webview or open an in-app browser window. description: A Flutter plugin that allows you to add an inline webview or open an in-app browser window.
version: 1.3.0 version: 2.0.0
author: Lorenzo Pichilli <pichillilorenzo@gmail.com> author: Lorenzo Pichilli <pichillilorenzo@gmail.com>
homepage: https://github.com/pichillilorenzo/flutter_inappbrowser homepage: https://github.com/pichillilorenzo/flutter_inappbrowser
......
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