fix #182, updated java classes for Flutter 1.12 new Java Embedding API (Android)
This commit is contained in:
parent
63f77cf18f
commit
5e272c460f
554
.idea/workspace.xml
generated
554
.idea/workspace.xml
generated
@ -6,6 +6,7 @@
|
||||
</shared>
|
||||
</component>
|
||||
<component name="AndroidLogFilters">
|
||||
<option name="TOOL_WINDOW_LOG_LEVEL" value="verbose" />
|
||||
<option name="TOOL_WINDOW_CONFIGURED_FILTER" value="Show only selected application" />
|
||||
</component>
|
||||
<component name="CMakeSettings">
|
||||
@ -16,13 +17,60 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="9b41f7a2-a71e-4923-91fb-249d7815b3e7" name="Default" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/CredentialDatabaseHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/CredentialDatabaseHandler.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/FlutterWebView.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/FlutterWebView.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/FlutterWebViewFactory.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/FlutterWebViewFactory.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppBrowser.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppBrowser.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppBrowserActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppBrowserActivity.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewChromeClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewChromeClient.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewClient.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewOptions.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewOptions.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewFlutterPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewFlutterPlugin.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewStatic.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewStatic.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/JavaScriptBridgeInterface.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/JavaScriptBridgeInterface.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Shared.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Shared.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Util.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Util.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/android/app/src/main/AndroidManifest.xml" beforeDir="false" afterPath="$PROJECT_DIR$/example/android/app/src/main/AndroidManifest.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/assets/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/example/assets/index.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/CHANGELOG.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/README.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/CredentialDatabaseHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/CredentialDatabaseHandler.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/FlutterWebView.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/FlutterWebView.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/FlutterWebViewFactory.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/FlutterWebViewFactory.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppBrowser.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppBrowser.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppBrowserActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppBrowserActivity.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewChromeClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewChromeClient.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewClient.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewOptions.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewOptions.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewFlutterPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewFlutterPlugin.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewStatic.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebViewStatic.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/JavaScriptBridgeInterface.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/JavaScriptBridgeInterface.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/MyCookieManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Shared.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Shared.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Util.java" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/Util.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/example/assets/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/example/assets/index.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/example/lib/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/example/lib/main.dart" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/example/test_driver/app_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/example/test_driver/app_test.dart" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/flutter_inappwebview.iml" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/flutter_inappwebview.iml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/lib/src/webview_options.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/lib/src/webview_options.dart" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/nodejs_server_test_auth_basic_and_ssl/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/nodejs_server_test_auth_basic_and_ssl/index.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/nodejs_server_test_auth_basic_and_ssl/public/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/nodejs_server_test_auth_basic_and_ssl/public/test-index.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/pubspec.yaml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/test.sh" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/test.sh" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/lib/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/main.dart" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/example/test_driver/app_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/app_test.dart" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/flutter_inappwebview.iml" beforeDir="false" afterPath="$PROJECT_DIR$/flutter_inappwebview.iml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/lib/src/webview_options.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/webview_options.dart" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/public/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/public/test-index.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/test.sh" beforeDir="false" afterPath="$PROJECT_DIR$/test.sh" afterDir="false" />
|
||||
</list>
|
||||
<ignored path="$PROJECT_DIR$/.dart_tool/" />
|
||||
<ignored path="$PROJECT_DIR$/.idea/" />
|
||||
@ -42,11 +90,11 @@
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="LGH870776aa626" />
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="224">
|
||||
<caret line="64" column="27" lean-forward="true" selection-start-line="64" selection-start-column="27" selection-end-line="64" selection-end-column="27" />
|
||||
<state relative-caret-position="445">
|
||||
<caret line="78" column="1" selection-start-line="78" selection-start-column="1" selection-end-line="78" selection-end-column="1" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
@ -54,23 +102,20 @@
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart">
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/example/assets/index.html">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="465">
|
||||
<caret line="36" column="3" selection-start-line="36" selection-start-column="3" selection-end-line="36" selection-end-column="3" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
<state relative-caret-position="212">
|
||||
<caret line="23" column="17" lean-forward="true" selection-start-line="23" selection-start-column="17" selection-end-line="23" selection-end-column="17" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/webview_options.dart">
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="328">
|
||||
<caret line="412" column="102" lean-forward="true" selection-start-line="412" selection-start-column="5" selection-end-line="412" selection-end-column="102" />
|
||||
<state relative-caret-position="211">
|
||||
<caret line="440" selection-start-line="440" selection-end-line="440" />
|
||||
<folding>
|
||||
<element signature="e#0#17#0" expanded="true" />
|
||||
</folding>
|
||||
@ -79,46 +124,11 @@
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart">
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="195">
|
||||
<caret line="13" selection-start-line="13" selection-end-line="13" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/types.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="30285">
|
||||
<caret line="2026" column="38" selection-start-line="2026" selection-start-column="38" selection-end-line="2026" selection-end-column="38" />
|
||||
<state relative-caret-position="399">
|
||||
<caret line="54" column="29" selection-start-line="54" selection-start-column="29" selection-end-line="54" selection-end-column="29" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/in_app_browser.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="535">
|
||||
<caret line="315" column="50" selection-start-line="315" selection-start-column="50" selection-end-line="315" selection-end-column="50" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="48">
|
||||
<caret line="412" column="372" selection-start-line="412" selection-start-column="372" selection-end-line="412" selection-end-column="372" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
<element signature="e#0#39#0" expanded="true" />
|
||||
<element signature="e#0#39#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
@ -126,10 +136,31 @@
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/main_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="180">
|
||||
<caret line="12" column="34" selection-start-line="12" selection-start-column="34" selection-end-line="12" selection-end-column="34" />
|
||||
<state relative-caret-position="264">
|
||||
<caret line="48" column="91" selection-start-line="48" selection-start-column="91" selection-end-line="48" selection-end-column="91" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/app_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="554">
|
||||
<caret line="360" column="33" selection-start-line="360" selection-start-column="33" selection-end-line="360" selection-end-column="33" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_ssl_request_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="367">
|
||||
<caret line="52" column="22" selection-start-line="50" selection-start-column="20" selection-end-line="52" selection-end-column="22" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@ -146,13 +177,6 @@
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>defa</find>
|
||||
<find>InAppWebViewStatic</find>
|
||||
<find>removeFromSuperview</find>
|
||||
<find>onCall</find>
|
||||
<find>onLoad</find>
|
||||
<find>printCu</find>
|
||||
<find>onLoadRe</find>
|
||||
<find>onPrint</find>
|
||||
<find>ontARGET</find>
|
||||
<find>onCreateWindow</find>
|
||||
@ -173,9 +197,16 @@
|
||||
<find>ThreadedInputConnecti</find>
|
||||
<find>InputAwareWebView</find>
|
||||
<find>\n</find>
|
||||
<find>dropDownWorkaroundEnabled</find>
|
||||
<find>debuggingEnabled</find>
|
||||
<find>_inappweb</find>
|
||||
<find>\n" +</find>
|
||||
<find>This workaround is applied as soon as the web page fires the `DOMContentLoaded` JavaScript event.</find>
|
||||
<find>dispose</find>
|
||||
<find>InAppWebViewOnCreateWindowTest</find>
|
||||
<find>InAppWebViewOnTarget</find>
|
||||
<find>InAppWebViewOnReceivedHttpAuthRequestTest</find>
|
||||
<find>dropDownWorkaroundEnabled</find>
|
||||
<find>mContext</find>
|
||||
</findStrings>
|
||||
<replaceStrings>
|
||||
<replace>activity.getPreferences(0)</replace>
|
||||
@ -199,9 +230,6 @@
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_file_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_javascript_handler_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_console_message_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_download_start_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_find_result_received_test.dart" />
|
||||
@ -211,7 +239,6 @@
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_navigation_state_change_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_progress_changed_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_safe_browsing_hit_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_scroll_changed_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_target_blank_test.dart" />
|
||||
@ -228,32 +255,37 @@
|
||||
<option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/css/style.css" />
|
||||
<option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.html" />
|
||||
<option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/js/main.js" />
|
||||
<option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" />
|
||||
<option value="$PROJECT_DIR$/.github/ISSUE_TEMPLATE/BUG_REPORT.md" />
|
||||
<option value="$PROJECT_DIR$/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md" />
|
||||
<option value="$PROJECT_DIR$/example/assets/index.html" />
|
||||
<option value="$PROJECT_DIR$/android/src/main/res/values/styles.xml" />
|
||||
<option value="$PROJECT_DIR$/pubspec.yaml" />
|
||||
<option value="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" />
|
||||
<option value="$PROJECT_DIR$/example/assets/css/style.css" />
|
||||
<option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_create_window_test.html" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/main_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_create_window_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/assets/js/main.js" />
|
||||
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
|
||||
<option value="$PROJECT_DIR$/lib/src/types.dart" />
|
||||
<option value="$PROJECT_DIR$/lib/src/in_app_browser.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_should_override_url_loading_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart" />
|
||||
<option value="$PROJECT_DIR$/lib/src/in_app_webview.dart" />
|
||||
<option value="$PROJECT_DIR$/CHANGELOG.md" />
|
||||
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
|
||||
<option value="$PROJECT_DIR$/example/android/app/src/main/AndroidManifest.xml" />
|
||||
<option value="$PROJECT_DIR$/pubspec.yaml" />
|
||||
<option value="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" />
|
||||
<option value="$PROJECT_DIR$/README.md" />
|
||||
<option value="$PROJECT_DIR$/CHANGELOG.md" />
|
||||
<option value="$PROJECT_DIR$/lib/src/webview_options.dart" />
|
||||
<option value="$PROJECT_DIR$/test.sh" />
|
||||
<option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/main_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/test_driver/app_test.dart" />
|
||||
<option value="$PROJECT_DIR$/example/lib/main.dart" />
|
||||
<option value="$PROJECT_DIR$/example/assets/index.html" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<component name="ProjectFrameBounds" extendedState="6">
|
||||
<option name="x" value="-1" />
|
||||
<option name="y" value="23" />
|
||||
<option name="width" value="1920" />
|
||||
<option name="height" value="1057" />
|
||||
@ -265,6 +297,45 @@
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="PackagesPane" />
|
||||
<pane id="Scope">
|
||||
<subPane subId="Project Files">
|
||||
<expand>
|
||||
<path>
|
||||
<item name="Root" type="cbb8eebc:String" user="Root" />
|
||||
<item name="flutter_inappbrowser" type="cbb8eebc:String" user="flutter_inappbrowser" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="flutter_inappwebview" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="flutter_inappwebview" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="flutter_inappwebview" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="flutter_inappwebview" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="example" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="flutter_inappwebview" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="flutter_inappwebview" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="example" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="assets" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="flutter_inappwebview" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="flutter_inappwebview" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="example" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="AndroidView">
|
||||
<subPane>
|
||||
<expand>
|
||||
@ -294,39 +365,6 @@
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope">
|
||||
<subPane subId="Project Files">
|
||||
<expand>
|
||||
<path>
|
||||
<item name="Root" type="cbb8eebc:String" user="Root" />
|
||||
<item name="flutter_inappbrowser" type="cbb8eebc:String" user="flutter_inappbrowser" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="flutter_inappwebview" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="flutter_inappwebview" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="flutter_inappwebview" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="flutter_inappwebview" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="flutter_inappwebview" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="flutter_inappwebview" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
@ -476,10 +514,10 @@
|
||||
</todo-panel>
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="0" y="23" width="1920" height="1057" extended-state="0" />
|
||||
<frame x="-1" y="23" width="1920" height="1057" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.6177474" visible="true" weight="0.1368477" />
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.6177474" visible="true" weight="0.22523962" />
|
||||
<window_info id="Structure" order="1" sideWeight="0.38225257" side_tool="true" weight="0.2087327" />
|
||||
<window_info id="Designer" order="2" />
|
||||
<window_info id="Build Variants" order="3" side_tool="true" />
|
||||
@ -489,8 +527,8 @@
|
||||
<window_info id="Image Layers" order="7" />
|
||||
<window_info id="Resources Explorer" order="8" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<window_info anchor="bottom" id="Find" order="1" weight="0.32745314" />
|
||||
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.49478307" visible="true" weight="0.38445595" />
|
||||
<window_info anchor="bottom" id="Find" order="1" weight="0.32642487" />
|
||||
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49478307" weight="0.38445595" />
|
||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.34196892" />
|
||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||
@ -498,10 +536,10 @@
|
||||
<window_info anchor="bottom" id="Android Profiler" order="7" show_stripe_button="false" />
|
||||
<window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.50532484" side_tool="true" weight="0.35751295" />
|
||||
<window_info anchor="bottom" id="Version Control" order="9" />
|
||||
<window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.4946752" weight="0.2507772" />
|
||||
<window_info anchor="bottom" id="Logcat" order="11" weight="0.32953367" />
|
||||
<window_info anchor="bottom" id="Messages" order="12" sideWeight="0.4968051" weight="0.33782384" />
|
||||
<window_info anchor="bottom" id="Dependency Viewer" order="13" weight="0.32800853" />
|
||||
<window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.4946752" weight="0.32435232" />
|
||||
<window_info anchor="bottom" id="Messages" order="11" sideWeight="0.4968051" weight="0.33782384" />
|
||||
<window_info anchor="bottom" id="Dependency Viewer" order="12" weight="0.32800853" />
|
||||
<window_info anchor="bottom" id="Logcat" order="13" visible="true" weight="0.41968912" />
|
||||
<window_info anchor="bottom" id="Dart Analysis" order="14" weight="0.3253886" />
|
||||
<window_info anchor="bottom" id="Flutter Performance" order="15" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Build" order="16" />
|
||||
@ -529,47 +567,6 @@
|
||||
</ignored-roots>
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/ios/Classes/InAppWebViewFlutterPlugin.h">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="285">
|
||||
<caret line="19" column="36" selection-start-line="19" selection-start-column="36" selection-end-line="19" selection-end-column="36" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/ios/Classes/InAppWebViewFlutterPlugin.m">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="300">
|
||||
<caret line="20" column="41" selection-start-line="20" selection-start-column="16" selection-end-line="20" selection-end-column="41" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/ios/Classes/SwiftFlutterPlugin.swift">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="765">
|
||||
<caret line="51" column="91" selection-start-line="51" selection-start-column="71" selection-end-line="51" selection-end-column="91" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/http_auth_credentials_database.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="195">
|
||||
<caret line="13" column="101" selection-start-line="13" selection-start-column="101" selection-end-line="13" selection-end-column="101" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_initial_file_test.html">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="135">
|
||||
<caret line="9" column="22" selection-start-line="9" selection-start-column="22" selection-end-line="9" selection-end-column="22" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/android/src/main/AndroidManifest.xml">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/.git/description">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</entry>
|
||||
@ -597,13 +594,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_ssl_request_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="367">
|
||||
<caret line="52" column="22" selection-start-line="50" selection-start-column="20" selection-end-line="52" selection-end-column="22" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_initial_file_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="96">
|
||||
@ -654,13 +644,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/public/index.html">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="210">
|
||||
<caret line="14" column="7" lean-forward="true" selection-end-line="14" selection-end-column="7" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/public/css/style.css">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="30">
|
||||
@ -675,13 +658,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="285">
|
||||
<caret line="19" selection-start-line="19" selection-end-line="19" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="120">
|
||||
@ -739,20 +715,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/android/app/src/main/AndroidManifest.xml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="52">
|
||||
<caret line="36" column="39" lean-forward="true" selection-start-line="36" selection-start-column="39" selection-end-line="36" selection-end-column="39" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/assets/index.html">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="77">
|
||||
<caret line="14" column="24" selection-start-line="14" selection-start-column="24" selection-end-line="14" selection-end-column="24" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/cookie_manager.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="203">
|
||||
@ -777,40 +739,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_create_window_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="345">
|
||||
<caret line="23" column="24" lean-forward="true" selection-start-line="23" selection-start-column="24" selection-end-line="23" selection-end-column="24" />
|
||||
<folding>
|
||||
<element signature="e#0#39#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/main_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="690">
|
||||
<caret line="46" column="56" lean-forward="true" selection-start-line="46" selection-start-column="56" selection-end-line="46" selection-end-column="56" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="165">
|
||||
<caret line="11" column="10" selection-start-line="11" selection-start-column="10" selection-end-line="11" selection-end-column="10" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="454">
|
||||
<caret line="58" column="49" selection-start-line="58" selection-start-column="49" selection-end-line="58" selection-end-column="49" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/assets/js/main.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="45">
|
||||
@ -828,13 +756,45 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart">
|
||||
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-136">
|
||||
<caret line="73" column="39" selection-start-line="73" selection-start-column="39" selection-end-line="73" selection-end-column="39" />
|
||||
<folding>
|
||||
<element signature="e#0#39#0" expanded="true" />
|
||||
</folding>
|
||||
<state relative-caret-position="210">
|
||||
<caret line="14" lean-forward="true" selection-start-line="14" selection-end-line="14" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/android/app/src/main/java/com/pichillilorenzo/flutterwebviewexample/MainActivity.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="60">
|
||||
<caret line="7" column="13" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/android/app/src/main/java/com/pichillilorenzo/flutterwebviewexample/EmbedderV1Activity.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="60">
|
||||
<caret line="6" column="13" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="105">
|
||||
<caret line="12" column="19" selection-start-line="12" selection-start-column="19" selection-end-line="12" selection-end-column="19" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/android/app/src/main/AndroidManifest.xml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="180">
|
||||
<caret line="67" column="47" lean-forward="true" selection-start-line="67" selection-start-column="47" selection-end-line="67" selection-end-column="47" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="45">
|
||||
<caret line="3" column="23" selection-start-line="3" selection-start-column="23" selection-end-line="3" selection-end-column="23" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@ -848,16 +808,19 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart">
|
||||
<entry file="file://$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="195">
|
||||
<caret line="13" selection-start-line="13" selection-end-line="13" />
|
||||
<state relative-caret-position="15">
|
||||
<caret line="35" column="14" selection-start-line="35" selection-start-column="14" selection-end-line="112" selection-end-column="16" />
|
||||
<folding>
|
||||
<element signature="e#0#39#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/types.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="30285">
|
||||
<state relative-caret-position="491">
|
||||
<caret line="2026" column="38" selection-start-line="2026" selection-start-column="38" selection-end-line="2026" selection-end-column="38" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
@ -865,55 +828,136 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/in_app_browser.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-3314">
|
||||
<caret line="315" column="50" selection-start-line="315" selection-start-column="50" selection-end-line="315" selection-end-column="50" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_create_window_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="160">
|
||||
<caret line="15" column="54" selection-start-line="15" selection-start-column="24" selection-end-line="15" selection-end-column="54" />
|
||||
<folding>
|
||||
<element signature="e#0#39#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/webview_options.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="330">
|
||||
<caret line="552" column="81" selection-start-line="552" selection-start-column="81" selection-end-line="552" selection-end-column="81" />
|
||||
<folding>
|
||||
<element signature="e#0#17#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/test.sh">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="45">
|
||||
<caret line="3" column="18" selection-start-line="3" selection-start-column="18" selection-end-line="3" selection-end-column="18" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/public/test-index.html">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="210">
|
||||
<caret line="14" column="7" selection-end-line="14" selection-end-column="7" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/main_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="264">
|
||||
<caret line="48" column="91" selection-start-line="48" selection-start-column="91" selection-end-line="48" selection-end-column="91" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="180">
|
||||
<caret line="12" column="34" selection-start-line="12" selection-start-column="34" selection-end-line="12" selection-end-column="34" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/in_app_browser.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="535">
|
||||
<caret line="315" column="50" selection-start-line="315" selection-start-column="50" selection-end-line="315" selection-end-column="50" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
<state relative-caret-position="165">
|
||||
<caret line="11" column="73" selection-start-line="11" selection-start-column="73" selection-end-line="11" selection-end-column="73" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="48">
|
||||
<caret line="412" column="372" selection-start-line="412" selection-start-column="372" selection-end-line="412" selection-end-column="372" />
|
||||
<state relative-caret-position="149">
|
||||
<caret line="413" column="267" selection-start-line="413" selection-start-column="267" selection-end-line="413" selection-end-column="267" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
<element signature="e#0#39#0" expanded="true" />
|
||||
<element signature="e#0#39#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/webview_options.dart">
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/app_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="328">
|
||||
<caret line="412" column="102" lean-forward="true" selection-start-line="412" selection-start-column="5" selection-end-line="412" selection-end-column="102" />
|
||||
<state relative-caret-position="554">
|
||||
<caret line="360" column="33" selection-start-line="360" selection-start-column="33" selection-end-line="360" selection-end-column="33" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_ssl_request_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="367">
|
||||
<caret line="52" column="22" selection-start-line="50" selection-start-column="20" selection-end-line="52" selection-end-column="22" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="211">
|
||||
<caret line="440" selection-start-line="440" selection-end-line="440" />
|
||||
<folding>
|
||||
<element signature="e#0#17#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="531">
|
||||
<caret line="111" selection-start-line="111" selection-end-line="111" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="399">
|
||||
<caret line="54" column="29" selection-start-line="54" selection-start-column="29" selection-end-line="54" selection-end-column="29" />
|
||||
<folding>
|
||||
<element signature="e#0#39#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="224">
|
||||
<caret line="64" column="27" lean-forward="true" selection-start-line="64" selection-start-column="27" selection-end-line="64" selection-end-column="27" />
|
||||
<state relative-caret-position="445">
|
||||
<caret line="78" column="1" selection-start-line="78" selection-start-column="1" selection-end-line="78" selection-end-column="1" />
|
||||
<folding>
|
||||
<element signature="e#0#20#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/assets/index.html">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="212">
|
||||
<caret line="23" column="17" lean-forward="true" selection-start-line="23" selection-start-column="17" selection-end-line="23" selection-end-column="17" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="masterDetails">
|
||||
<states>
|
||||
|
@ -1,5 +1,6 @@
|
||||
## 2.2.0
|
||||
## 3.0.0
|
||||
|
||||
- Updated for Flutter 1.12 new Java Embedding API (Android)
|
||||
- Updated `clearCache` for Android
|
||||
- Added `Promise` javascript [polyfill](https://github.com/taylorhakes/promise-polyfill/blob/master/src/index.js) for webviews that doesn't support it for `window.flutter_inappwebview.callHandler`
|
||||
- Added `getDefaultUserAgent` static method to `InAppWebViewController`
|
||||
@ -11,6 +12,7 @@
|
||||
- Fix for Android `InAppBrowser` for some controller methods not exposed.
|
||||
- Merge "Fixes null error when calling getOptions for InAppBrowser class" [#214](https://github.com/pichillilorenzo/flutter_inappwebview/pull/214) (thanks to [panndoraBoo](https://github.com/panndoraBoo))
|
||||
- Added `dropDownWorkaroundEnabled` webview option for Android to enable a temporary workaround for html dropdowns (issue [#182](https://github.com/pichillilorenzo/flutter_inappwebview/issues/182))
|
||||
- Fixed "App Crashes after clicking on dropdown (Using inappwebview)" [#182](https://github.com/pichillilorenzo/flutter_inappwebview/issues/182)
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
|
@ -13,11 +13,13 @@ A Flutter plugin that allows you to add an inline webview or open an in-app brow
|
||||
|
||||
- Dart sdk: ">=2.0.0-dev.68.0 <3.0.0"
|
||||
- Flutter: ">=1.9.1+hotfix.5 <2.0.0"
|
||||
- Android: `minSdkVersion 17`
|
||||
- Android: `minSdkVersion 17` and add support for `androidx` (see [AndroidX Migration](https://flutter.dev/docs/development/androidx-migration) to migrate an existing app)
|
||||
- iOS: `--ios-language swift`, Xcode version `>= 11`
|
||||
|
||||
### IMPORTANT Note for Android
|
||||
|
||||
If you are starting a new fresh app, you need to create the Flutter App with `flutter create --androidx -i swift` to add support for `androidx`, otherwise it won't work (see [AndroidX Migration](https://flutter.dev/docs/development/androidx-migration) to migrate an existing app).
|
||||
|
||||
During the build, if Android fails with `Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 17 declared in library`, it means that you need to update the `minSdkVersion` of your `android/app/build.gradle` file to at least `17`.
|
||||
|
||||
Also, you need to add `<uses-permission android:name="android.permission.INTERNET"/>` in the `android/app/src/main/AndroidManifest.xml` file in order to give minimum permission to perform network operations in your application.
|
||||
@ -26,7 +28,7 @@ Because of [Flutter AndroidX compatibility](https://flutter.dev/docs/development
|
||||
|
||||
### IMPORTANT Note for iOS
|
||||
|
||||
If you are starting a new fresh app, you need to create the Flutter App with `flutter create -i swift` (see [flutter/flutter#13422 (comment)](https://github.com/flutter/flutter/issues/13422#issuecomment-392133780)), otherwise, you will get this message:
|
||||
If you are starting a new fresh app, you need to create the Flutter App with `flutter create --androidx -i swift` (see [flutter/flutter#13422 (comment)](https://github.com/flutter/flutter/issues/13422#issuecomment-392133780)), otherwise, you will get this message:
|
||||
```
|
||||
=== BUILD TARGET flutter_inappwebview OF PROJECT Pods WITH CONFIGURATION Debug ===
|
||||
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2, 5.0. This setting can be set in the build settings editor.
|
||||
@ -410,7 +412,6 @@ Instead, on the `onLoadStop` WebView event, you can use `callHandler` directly:
|
||||
* `hardwareAcceleration`: Boolean value to enable Hardware Acceleration in the WebView.
|
||||
* `supportMultipleWindows`: Sets whether the WebView whether supports multiple windows.
|
||||
* `regexToCancelSubFramesLoading`: Regular expression used by `shouldOverrideUrlLoading` event to cancel navigation for frames that are not the main frame. If the url request of a subframe matches the regular expression, then the request of that subframe is canceled.
|
||||
* `dropDownWorkaroundEnabled`: Enable a temporary workaround for html dropdowns (`<select>` tags) (available on Android 19+). It requires **JavaScript enabled**. It attempts to block click events for the dropdowns creating a custom `<div>` layer over the dropdown to intercept user's clicks. This workaround is applied as soon as the web page fires the `DOMContentLoaded` JavaScript event. The default value is `false`.
|
||||
|
||||
##### `InAppWebView` iOS-specific options
|
||||
|
||||
|
@ -13,6 +13,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.flutter.plugin.common.BinaryMessenger;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.flutter.plugin.common.PluginRegistry;
|
||||
@ -22,15 +23,13 @@ public class CredentialDatabaseHandler implements MethodChannel.MethodCallHandle
|
||||
|
||||
static final String LOG_TAG = "CredentialDatabaseHandler";
|
||||
|
||||
public static PluginRegistry.Registrar registrar;
|
||||
public static MethodChannel channel;
|
||||
public static CredentialDatabase credentialDatabase;
|
||||
|
||||
public CredentialDatabaseHandler(PluginRegistry.Registrar r) {
|
||||
registrar = r;
|
||||
channel = new MethodChannel(registrar.messenger(), "com.pichillilorenzo/flutter_inappwebview_credential_database");
|
||||
public CredentialDatabaseHandler(BinaryMessenger messenger) {
|
||||
channel = new MethodChannel(messenger, "com.pichillilorenzo/flutter_inappwebview_credential_database");
|
||||
channel.setMethodCallHandler(this);
|
||||
credentialDatabase = CredentialDatabase.getInstance(registrar.context());
|
||||
credentialDatabase = CredentialDatabase.getInstance(Shared.applicationContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import android.hardware.display.DisplayManager;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.View;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebView;
|
||||
@ -15,10 +16,12 @@ import com.pichillilorenzo.flutter_inappwebview.InAppWebView.InAppWebView;
|
||||
import com.pichillilorenzo.flutter_inappwebview.InAppWebView.InAppWebViewOptions;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.flutter.plugin.common.BinaryMessenger;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.flutter.plugin.common.PluginRegistry.Registrar;
|
||||
@ -31,15 +34,10 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
|
||||
|
||||
static final String LOG_TAG = "FlutterWebView";
|
||||
|
||||
public final Activity activity;
|
||||
public InAppWebView webView;
|
||||
public final MethodChannel channel;
|
||||
public final Registrar registrar;
|
||||
|
||||
public FlutterWebView(Registrar registrar, final Context context, int id, HashMap<String, Object> params, View containerView) {
|
||||
this.registrar = registrar;
|
||||
this.activity = registrar.activity();
|
||||
|
||||
public FlutterWebView(BinaryMessenger messenger, final Context context, int id, HashMap<String, Object> params, View containerView) {
|
||||
DisplayListenerProxy displayListenerProxy = new DisplayListenerProxy();
|
||||
DisplayManager displayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
|
||||
displayListenerProxy.onPreWebViewInitialization(displayManager);
|
||||
@ -53,17 +51,31 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
|
||||
InAppWebViewOptions options = new InAppWebViewOptions();
|
||||
options.parse(initialOptions);
|
||||
|
||||
webView = new InAppWebView(registrar, context, this, id, options, containerView);
|
||||
webView = new InAppWebView(Shared.activity, this, id, options, containerView);
|
||||
displayListenerProxy.onPostWebViewInitialization(displayManager);
|
||||
|
||||
// fix https://github.com/pichillilorenzo/flutter_inappwebview/issues/182
|
||||
try {
|
||||
Class superClass = webView.getClass().getSuperclass();
|
||||
while(!superClass.getName().equals("android.view.View")) {
|
||||
superClass = superClass.getSuperclass();
|
||||
}
|
||||
Field mContext = superClass.getDeclaredField("mContext");
|
||||
mContext.setAccessible(true);
|
||||
mContext.set(webView, context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e(LOG_TAG, "Cannot find mContext for this WebView");
|
||||
}
|
||||
|
||||
webView.prepare();
|
||||
|
||||
channel = new MethodChannel(registrar.messenger(), "com.pichillilorenzo/flutter_inappwebview_" + id);
|
||||
channel = new MethodChannel(messenger, "com.pichillilorenzo/flutter_inappwebview_" + id);
|
||||
channel.setMethodCallHandler(this);
|
||||
|
||||
if (initialFile != null) {
|
||||
try {
|
||||
initialUrl = Util.getUrlAsset(registrar, initialFile);
|
||||
initialUrl = Util.getUrlAsset(initialFile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Log.e(LOG_TAG, initialFile + " asset file cannot be found!", e);
|
||||
@ -375,12 +387,17 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
|
||||
webView.unlockInputConnection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFlutterViewAttached(View flutterView) {
|
||||
webView.setContainerView(flutterView);
|
||||
if (webView != null) {
|
||||
webView.setContainerView(flutterView);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFlutterViewDetached() {
|
||||
webView.setContainerView(null);
|
||||
if (webView != null) {
|
||||
webView.setContainerView(null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -5,25 +5,26 @@ import android.view.View;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import io.flutter.plugin.common.BinaryMessenger;
|
||||
import io.flutter.plugin.common.PluginRegistry.Registrar;
|
||||
import io.flutter.plugin.common.StandardMessageCodec;
|
||||
import io.flutter.plugin.platform.PlatformView;
|
||||
import io.flutter.plugin.platform.PlatformViewFactory;
|
||||
|
||||
public class FlutterWebViewFactory extends PlatformViewFactory {
|
||||
private final Registrar registrar;
|
||||
private final View containerView;
|
||||
private final BinaryMessenger messenger;
|
||||
|
||||
public FlutterWebViewFactory(Registrar registrar, View containerView) {
|
||||
public FlutterWebViewFactory(BinaryMessenger messenger, View containerView) {
|
||||
super(StandardMessageCodec.INSTANCE);
|
||||
this.registrar = registrar;
|
||||
this.containerView = containerView;
|
||||
this.messenger = messenger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformView create(Context context, int id, Object args) {
|
||||
HashMap<String, Object> params = (HashMap<String, Object>) args;
|
||||
return new FlutterWebView(registrar, context, id, params, containerView);
|
||||
return new FlutterWebView(messenger, context, id, params, containerView);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
package com.pichillilorenzo.flutter_inappwebview;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
@ -47,6 +48,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.flutter.plugin.common.BinaryMessenger;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.flutter.plugin.common.MethodChannel.Result;
|
||||
@ -57,16 +59,14 @@ import io.flutter.plugin.common.PluginRegistry.Registrar;
|
||||
*/
|
||||
public class InAppBrowser implements MethodChannel.MethodCallHandler {
|
||||
|
||||
public Registrar registrar;
|
||||
public MethodChannel channel;
|
||||
public Map<String, InAppBrowserActivity> webViewActivities = new HashMap<>();
|
||||
public Map<String, ChromeCustomTabsActivity> chromeCustomTabsActivities = new HashMap<>();
|
||||
|
||||
protected static final String LOG_TAG = "IABFlutterPlugin";
|
||||
|
||||
public InAppBrowser(Registrar r) {
|
||||
registrar = r;
|
||||
channel = new MethodChannel(registrar.messenger(), "com.pichillilorenzo/flutter_inappbrowser");
|
||||
public InAppBrowser(BinaryMessenger messenger) {
|
||||
channel = new MethodChannel(messenger, "com.pichillilorenzo/flutter_inappbrowser");
|
||||
channel.setMethodCallHandler(this);
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ public class InAppBrowser implements MethodChannel.MethodCallHandler {
|
||||
public void onMethodCall(final MethodCall call, final Result result) {
|
||||
String source;
|
||||
String urlFile;
|
||||
final Activity activity = registrar.activity();
|
||||
final Activity activity = Shared.activity;
|
||||
final String uuid = (String) call.argument("uuid");
|
||||
|
||||
switch (call.method) {
|
||||
@ -114,7 +114,7 @@ public class InAppBrowser implements MethodChannel.MethodCallHandler {
|
||||
if (isLocalFile) {
|
||||
// check if the asset file exists
|
||||
try {
|
||||
url = Util.getUrlAsset(registrar, url);
|
||||
url = Util.getUrlAsset(url);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
result.error(LOG_TAG, url + " asset file cannot be found!", e);
|
||||
|
@ -58,7 +58,6 @@ public class InAppBrowserActivity extends AppCompatActivity {
|
||||
|
||||
webView = findViewById(R.id.webView);
|
||||
webView.inAppBrowserActivity = this;
|
||||
webView.registrar = InAppWebViewFlutterPlugin.inAppBrowser.registrar;
|
||||
|
||||
Bundle b = getIntent().getExtras();
|
||||
uuid = b.getString("uuid");
|
||||
|
@ -38,6 +38,7 @@ import com.pichillilorenzo.flutter_inappwebview.InAppBrowserActivity;
|
||||
import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin;
|
||||
import com.pichillilorenzo.flutter_inappwebview.JavaScriptBridgeInterface;
|
||||
import com.pichillilorenzo.flutter_inappwebview.R;
|
||||
import com.pichillilorenzo.flutter_inappwebview.Shared;
|
||||
import com.pichillilorenzo.flutter_inappwebview.Util;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@ -58,7 +59,6 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
|
||||
static final String LOG_TAG = "InAppWebView";
|
||||
|
||||
public PluginRegistry.Registrar registrar;
|
||||
public InAppBrowserActivity inAppBrowserActivity;
|
||||
public FlutterWebView flutterWebView;
|
||||
public int id;
|
||||
@ -514,450 +514,6 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
" };" +
|
||||
"})(window.fetch);";
|
||||
|
||||
// Android API 19+
|
||||
// ResizeSensor: https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js
|
||||
static final String dropDownWorkaroundJS = "(function() {" +
|
||||
" function dropDownWorkaround(window, document) {" +
|
||||
" var uuid = 0;" +
|
||||
" function prepare() {" +
|
||||
" if (typeof window === 'undefined') {" +
|
||||
" return null;" +
|
||||
" }" +
|
||||
" var globalWindow =" +
|
||||
" typeof window != 'undefined' && window.Math == Math" +
|
||||
" ? window" +
|
||||
" : typeof self != 'undefined' && self.Math == Math" +
|
||||
" ? self" +
|
||||
" : Function('return this')();" +
|
||||
" var requestAnimationFrame =" +
|
||||
" globalWindow.requestAnimationFrame ||" +
|
||||
" globalWindow.mozRequestAnimationFrame ||" +
|
||||
" globalWindow.webkitRequestAnimationFrame ||" +
|
||||
" function(fn) {" +
|
||||
" return globalWindow.setTimeout(fn, 20);" +
|
||||
" };" +
|
||||
" function forEachElement(elements, callback) {" +
|
||||
" var elementsType = Object.prototype.toString.call(elements);" +
|
||||
" var isCollectionTyped =" +
|
||||
" '[object Array]' === elementsType ||" +
|
||||
" '[object NodeList]' === elementsType ||" +
|
||||
" '[object HTMLCollection]' === elementsType ||" +
|
||||
" '[object Object]' === elementsType ||" +
|
||||
" ('undefined' !== typeof jQuery && elements instanceof jQuery) ||" +
|
||||
" ('undefined' !== typeof Elements && elements instanceof Elements);" +
|
||||
" var i = 0," +
|
||||
" j = elements.length;" +
|
||||
" if (isCollectionTyped) {" +
|
||||
" for (; i < j; i++) {" +
|
||||
" callback(elements[i]);" +
|
||||
" }" +
|
||||
" } else {" +
|
||||
" callback(elements);" +
|
||||
" }" +
|
||||
" }" +
|
||||
" function getElementSize(element) {" +
|
||||
" if (!element.getBoundingClientRect) {" +
|
||||
" return {" +
|
||||
" width: element.offsetWidth," +
|
||||
" height: element.offsetHeight" +
|
||||
" };" +
|
||||
" }" +
|
||||
" var rect = element.getBoundingClientRect();" +
|
||||
" return {" +
|
||||
" width: Math.round(rect.width)," +
|
||||
" height: Math.round(rect.height)" +
|
||||
" };" +
|
||||
" }" +
|
||||
" function setStyle(element, style) {" +
|
||||
" Object.keys(style).forEach(function(key) {" +
|
||||
" element.style[key] = style[key];" +
|
||||
" });" +
|
||||
" }" +
|
||||
" var ResizeSensor = function(element, callback) {" +
|
||||
" var lastAnimationFrame = 0;" +
|
||||
" function EventQueue() {" +
|
||||
" var q = [];" +
|
||||
" this.add = function(ev) {" +
|
||||
" q.push(ev);" +
|
||||
" };" +
|
||||
" var i, j;" +
|
||||
" this.call = function(sizeInfo) {" +
|
||||
" for (i = 0, j = q.length; i < j; i++) {" +
|
||||
" q[i].call(this, sizeInfo);" +
|
||||
" }" +
|
||||
" };" +
|
||||
" this.remove = function(ev) {" +
|
||||
" var newQueue = [];" +
|
||||
" for (i = 0, j = q.length; i < j; i++) {" +
|
||||
" if (q[i] !== ev) newQueue.push(q[i]);" +
|
||||
" }" +
|
||||
" q = newQueue;" +
|
||||
" };" +
|
||||
" this.length = function() {" +
|
||||
" return q.length;" +
|
||||
" };" +
|
||||
" }" +
|
||||
" function attachResizeEvent(element, resized) {" +
|
||||
" if (!element) return;" +
|
||||
" if (element.resizedAttached) {" +
|
||||
" element.resizedAttached.add(resized);" +
|
||||
" return;" +
|
||||
" }" +
|
||||
" element.resizedAttached = new EventQueue();" +
|
||||
" element.resizedAttached.add(resized);" +
|
||||
" element.resizeSensor = document.createElement('div');" +
|
||||
" element.resizeSensor.dir = 'ltr';" +
|
||||
" element.resizeSensor.className = 'resize-sensor';" +
|
||||
" var style = {" +
|
||||
" pointerEvents: 'none'," +
|
||||
" position: 'absolute'," +
|
||||
" left: '0px'," +
|
||||
" top: '0px'," +
|
||||
" right: '0px'," +
|
||||
" bottom: '0px'," +
|
||||
" overflow: 'hidden'," +
|
||||
" zIndex: '-1'," +
|
||||
" visibility: 'hidden'," +
|
||||
" maxWidth: '100%'" +
|
||||
" };" +
|
||||
" var styleChild = {" +
|
||||
" position: 'absolute'," +
|
||||
" left: '0px'," +
|
||||
" top: '0px'," +
|
||||
" transition: '0s'" +
|
||||
" };" +
|
||||
" setStyle(element.resizeSensor, style);" +
|
||||
" var expand = document.createElement('div');" +
|
||||
" expand.className = 'resize-sensor-expand';" +
|
||||
" setStyle(expand, style);" +
|
||||
" var expandChild = document.createElement('div');" +
|
||||
" setStyle(expandChild, styleChild);" +
|
||||
" expand.appendChild(expandChild);" +
|
||||
" var shrink = document.createElement('div');" +
|
||||
" shrink.className = 'resize-sensor-shrink';" +
|
||||
" setStyle(shrink, style);" +
|
||||
" var shrinkChild = document.createElement('div');" +
|
||||
" setStyle(shrinkChild, styleChild);" +
|
||||
" setStyle(shrinkChild, { width: '200%', height: '200%' });" +
|
||||
" shrink.appendChild(shrinkChild);" +
|
||||
" element.resizeSensor.appendChild(expand);" +
|
||||
" element.resizeSensor.appendChild(shrink);" +
|
||||
" element.appendChild(element.resizeSensor);" +
|
||||
" var computedStyle = window.getComputedStyle(element);" +
|
||||
" var position = computedStyle" +
|
||||
" ? computedStyle.getPropertyValue('position')" +
|
||||
" : null;" +
|
||||
" if (" +
|
||||
" 'absolute' !== position &&" +
|
||||
" 'relative' !== position &&" +
|
||||
" 'fixed' !== position &&" +
|
||||
" 'sticky' !== position" +
|
||||
" ) {" +
|
||||
" element.style.position = 'relative';" +
|
||||
" }" +
|
||||
" var dirty, rafId;" +
|
||||
" var size = getElementSize(element);" +
|
||||
" var lastWidth = 0;" +
|
||||
" var lastHeight = 0;" +
|
||||
" var initialHiddenCheck = true;" +
|
||||
" lastAnimationFrame = 0;" +
|
||||
" var resetExpandShrink = function() {" +
|
||||
" var width = element.offsetWidth;" +
|
||||
" var height = element.offsetHeight;" +
|
||||
" expandChild.style.width = width + 10 + 'px';" +
|
||||
" expandChild.style.height = height + 10 + 'px';" +
|
||||
" expand.scrollLeft = width + 10;" +
|
||||
" expand.scrollTop = height + 10;" +
|
||||
" shrink.scrollLeft = width + 10;" +
|
||||
" shrink.scrollTop = height + 10;" +
|
||||
" };" +
|
||||
" var reset = function() {" +
|
||||
" if (initialHiddenCheck) {" +
|
||||
" var invisible =" +
|
||||
" element.offsetWidth === 0 && element.offsetHeight === 0;" +
|
||||
" if (invisible) {" +
|
||||
" if (!lastAnimationFrame) {" +
|
||||
" lastAnimationFrame = requestAnimationFrame(function() {" +
|
||||
" lastAnimationFrame = 0;" +
|
||||
" reset();" +
|
||||
" });" +
|
||||
" }" +
|
||||
" return;" +
|
||||
" } else {" +
|
||||
" initialHiddenCheck = false;" +
|
||||
" }" +
|
||||
" }" +
|
||||
" resetExpandShrink();" +
|
||||
" };" +
|
||||
" element.resizeSensor.resetSensor = reset;" +
|
||||
" var onResized = function() {" +
|
||||
" rafId = 0;" +
|
||||
" if (!dirty) return;" +
|
||||
" lastWidth = size.width;" +
|
||||
" lastHeight = size.height;" +
|
||||
" if (element.resizedAttached) {" +
|
||||
" element.resizedAttached.call(size);" +
|
||||
" }" +
|
||||
" };" +
|
||||
" var onScroll = function() {" +
|
||||
" size = getElementSize(element);" +
|
||||
" dirty = size.width !== lastWidth || size.height !== lastHeight;" +
|
||||
" if (dirty && !rafId) {" +
|
||||
" rafId = requestAnimationFrame(onResized);" +
|
||||
" }" +
|
||||
" reset();" +
|
||||
" };" +
|
||||
" var addEvent = function(el, name, cb) {" +
|
||||
" if (el.attachEvent) {" +
|
||||
" el.attachEvent('on' + name, cb);" +
|
||||
" } else {" +
|
||||
" el.addEventListener(name, cb);" +
|
||||
" }" +
|
||||
" };" +
|
||||
" addEvent(expand, 'scroll', onScroll);" +
|
||||
" addEvent(shrink, 'scroll', onScroll);" +
|
||||
" lastAnimationFrame = requestAnimationFrame(reset);" +
|
||||
" }" +
|
||||
" forEachElement(element, function(elem) {" +
|
||||
" attachResizeEvent(elem, callback);" +
|
||||
" });" +
|
||||
" this.detach = function(ev) {" +
|
||||
" if (!lastAnimationFrame) {" +
|
||||
" window.cancelAnimationFrame(lastAnimationFrame);" +
|
||||
" lastAnimationFrame = 0;" +
|
||||
" }" +
|
||||
" ResizeSensor.detach(element, ev);" +
|
||||
" };" +
|
||||
" this.reset = function() {" +
|
||||
" element.resizeSensor.resetSensor();" +
|
||||
" };" +
|
||||
" };" +
|
||||
" ResizeSensor.reset = function(element) {" +
|
||||
" forEachElement(element, function(elem) {" +
|
||||
" elem.resizeSensor.resetSensor();" +
|
||||
" });" +
|
||||
" };" +
|
||||
" ResizeSensor.detach = function(element, ev) {" +
|
||||
" forEachElement(element, function(elem) {" +
|
||||
" if (!elem) return;" +
|
||||
" if (elem.resizedAttached && typeof ev === 'function') {" +
|
||||
" elem.resizedAttached.remove(ev);" +
|
||||
" if (elem.resizedAttached.length()) return;" +
|
||||
" }" +
|
||||
" if (elem.resizeSensor) {" +
|
||||
" if (elem.contains(elem.resizeSensor)) {" +
|
||||
" elem.removeChild(elem.resizeSensor);" +
|
||||
" }" +
|
||||
" delete elem.resizeSensor;" +
|
||||
" delete elem.resizedAttached;" +
|
||||
" }" +
|
||||
" });" +
|
||||
" };" +
|
||||
" if (typeof MutationObserver !== 'undefined') {" +
|
||||
" var observer = new MutationObserver(function(mutations) {" +
|
||||
" for (var i in mutations) {" +
|
||||
" if (mutations.hasOwnProperty(i)) {" +
|
||||
" var items = mutations[i].addedNodes;" +
|
||||
" for (var j = 0; j < items.length; j++) {" +
|
||||
" if (items[j].resizeSensor) {" +
|
||||
" ResizeSensor.reset(items[j]);" +
|
||||
" }" +
|
||||
" }" +
|
||||
" }" +
|
||||
" }" +
|
||||
" });" +
|
||||
" document.addEventListener('DOMContentLoaded', function(event) {" +
|
||||
" observer.observe(document.body, {" +
|
||||
" childList: true," +
|
||||
" subtree: true" +
|
||||
" });" +
|
||||
" });" +
|
||||
" }" +
|
||||
" return ResizeSensor;" +
|
||||
" }" +
|
||||
" var ResizeSensor = prepare();" +
|
||||
" function pseudoStyle(htmlElement, pseudoElement, styles) {" +
|
||||
" var _sheetId = 'pseudoStyles';" +
|
||||
" var _head = document.head || document.getElementsByTagName('head')[0];" +
|
||||
" var _sheet =" +
|
||||
" document.getElementById(_sheetId) || document.createElement('style');" +
|
||||
" _sheet.id = _sheetId;" +
|
||||
" var styleClass = htmlElement.className.split(' ').join('.');" +
|
||||
" if (styleClass.charAt(0) != '.') {" +
|
||||
" styleClass = '.' + styleClass;" +
|
||||
" }" +
|
||||
" _sheet.innerHTML += '\\n' + styleClass + ':' + pseudoElement + '{';" +
|
||||
" for (var key in styles) {" +
|
||||
" _sheet.innerHTML += key + ':' + styles[key] + ';\\n';" +
|
||||
" }" +
|
||||
" _sheet.innerHTML += '}';" +
|
||||
" _head.appendChild(_sheet);" +
|
||||
" }" +
|
||||
" function getIndexSelectValues(select) {" +
|
||||
" var result = [];" +
|
||||
" var options = select && select.options;" +
|
||||
" for (var i = 0, iLen = options.length; i < iLen; i++) {" +
|
||||
" var opt = options[i];" +
|
||||
" if (opt.selected) {" +
|
||||
" result.push(i);" +
|
||||
" }" +
|
||||
" }" +
|
||||
" return result;" +
|
||||
" }" +
|
||||
" function setMultipleValues(select, values) {" +
|
||||
" var options = select && select.options;" +
|
||||
" for (var i = 0, iLen = options.length; i < iLen; i++) {" +
|
||||
" var opt = options[i];" +
|
||||
" opt.selected = values.indexOf(opt.value) >= 0;" +
|
||||
" }" +
|
||||
" }" +
|
||||
" function addSpanWrapper(selectElement) {" +
|
||||
" var spanElement = document.createElement('span');" +
|
||||
" spanElement.flutterInAppWebViewSelect = selectElement;" +
|
||||
" new ResizeSensor(spanElement, function() {" +
|
||||
" var style =" +
|
||||
" selectElement.currentStyle || window.getComputedStyle(selectElement);" +
|
||||
" var xMargin =" +
|
||||
" parseFloat(style.marginLeft) + parseFloat(style.marginRight);" +
|
||||
" var yMargin =" +
|
||||
" parseFloat(style.marginTop) + parseFloat(style.marginBottom);" +
|
||||
" selectElement.style.width =" +
|
||||
" spanElement.getBoundingClientRect().width - xMargin + 'px';" +
|
||||
" selectElement.style.height =" +
|
||||
" spanElement.getBoundingClientRect().height - yMargin + 'px';" +
|
||||
" });" +
|
||||
" spanElement.className = 'flutterInAppWebViewSelect-' + uuid;" +
|
||||
" spanElement.style.padding = '0px';" +
|
||||
" spanElement.style.margin = '0px';" +
|
||||
" spanElement.style.border = '0px';" +
|
||||
" spanElement.style.display = 'inline-block';" +
|
||||
" spanElement.style.backgroundColor = 'transparent';" +
|
||||
" spanElement.style.position = 'relative';" +
|
||||
" pseudoStyle(spanElement, 'before', {" +
|
||||
" content: '\\' \\''," +
|
||||
" width: '100%'," +
|
||||
" height: '100%'," +
|
||||
" position: 'absolute'," +
|
||||
" top: '0'," +
|
||||
" left: '0'," +
|
||||
" 'z-index': 99999999" +
|
||||
" });" +
|
||||
" selectElement.flutterInAppWebViewSpanWrapper = spanElement;" +
|
||||
" var clickEventListener = function(event) {" +
|
||||
" var self = this;" +
|
||||
" event.preventDefault();" +
|
||||
" var isDisabled = !!this.flutterInAppWebViewSelect.disabled;" +
|
||||
" if (isDisabled) {" +
|
||||
" return;" +
|
||||
" }" +
|
||||
" this.flutterInAppWebViewSelect.focus();" +
|
||||
" var options = [];" +
|
||||
" var optionElements = this.flutterInAppWebViewSelect.querySelectorAll(" +
|
||||
" 'option'" +
|
||||
" );" +
|
||||
" for (var i = 0; i < optionElements.length; i++) {" +
|
||||
" var optionElement = optionElements[i];" +
|
||||
" options.push({" +
|
||||
" key: optionElement.textContent," +
|
||||
" value: optionElement.value" +
|
||||
" });" +
|
||||
" }" +
|
||||
" var isMultiple = !!this.flutterInAppWebViewSelect.multiple;" +
|
||||
" window.flutter_inappwebview" +
|
||||
" .callHandler(" +
|
||||
" 'flutterInAppWebViewDropDownWorkaround'," +
|
||||
" getIndexSelectValues(this.flutterInAppWebViewSelect)," +
|
||||
" isMultiple," +
|
||||
" options" +
|
||||
" )" +
|
||||
" .then(function(result) {" +
|
||||
" if (result != null && result.values != null) {" +
|
||||
" if (!isMultiple) {" +
|
||||
" if (result.values.length > 0) {" +
|
||||
" self.flutterInAppWebViewSelect.value = result.values[0];" +
|
||||
" }" +
|
||||
" } else {" +
|
||||
" setMultipleValues(" +
|
||||
" self.flutterInAppWebViewSelect," +
|
||||
" result.values" +
|
||||
" );" +
|
||||
" }" +
|
||||
" }" +
|
||||
" var evt = document.createEvent('HTMLEvents');" +
|
||||
" evt.initEvent('change', false, true);" +
|
||||
" self.flutterInAppWebViewSelect.dispatchEvent(evt);" +
|
||||
" self.flutterInAppWebViewSelect.blur();" +
|
||||
" });" +
|
||||
" };" +
|
||||
" spanElement.addEventListener('click', clickEventListener);" +
|
||||
" divWithEventListeners.push({" +
|
||||
" spanElement: spanElement," +
|
||||
" clickEvent: clickEventListener" +
|
||||
" });" +
|
||||
" selectElement.parentNode.insertBefore(spanElement, selectElement);" +
|
||||
" spanElement.appendChild(selectElement);" +
|
||||
" uuid++;" +
|
||||
" }" +
|
||||
" function removeSpanWrapper(selectElement) {" +
|
||||
" if (selectElement.flutterInAppWebViewSpanWrapper) {" +
|
||||
" divWithEventListeners.splice(" +
|
||||
" divWithEventListeners.indexOf(" +
|
||||
" selectElement.flutterInAppWebViewSpanWrapper" +
|
||||
" )," +
|
||||
" 1" +
|
||||
" );" +
|
||||
" document.body.removeChild(selectElement.flutterInAppWebViewSpanWrapper);" +
|
||||
" }" +
|
||||
" }" +
|
||||
" var selectElements = document.querySelectorAll('select');" +
|
||||
" var divWithEventListeners = [];" +
|
||||
" for (var selectElement of selectElements) {" +
|
||||
" addSpanWrapper(selectElement);" +
|
||||
" }" +
|
||||
" var mutationObserver = new MutationObserver(function(mutations) {" +
|
||||
" mutations.forEach(function(mutation) {" +
|
||||
" for (var nodeElement of mutation.addedNodes) {" +
|
||||
" if (nodeElement.tagName == 'SELECT') {" +
|
||||
" addSpanWrapper(nodeElement);" +
|
||||
" }" +
|
||||
" }" +
|
||||
" for (var nodeElement of mutation.removedNodes) {" +
|
||||
" if (nodeElement.tagName == 'SELECT') {" +
|
||||
" removeSpanWrapper(nodeElement);" +
|
||||
" if (nodeElement.mutationObserver) {" +
|
||||
" nodeElement.mutationObserver.disconnect();" +
|
||||
" }" +
|
||||
" }" +
|
||||
" }" +
|
||||
" });" +
|
||||
" });" +
|
||||
" mutationObserver.observe(document.body, {" +
|
||||
" childList: true," +
|
||||
" subtree: true" +
|
||||
" });" +
|
||||
" }" +
|
||||
" document.addEventListener('DOMContentLoaded', function() {" +
|
||||
" dropDownWorkaround(window, document);" +
|
||||
" var iframes = document.querySelectorAll('iframe');" +
|
||||
" for (var i = 0; i < iframes.length; i++) {" +
|
||||
" var iframe = iframes[i];" +
|
||||
" var frameDocument;" +
|
||||
" try {" +
|
||||
" frameDocument = iframe.contentDocument;" +
|
||||
" if (!frameDocument && iframe.contentWindow) {" +
|
||||
" frameDocument = iframe.contentWindow.document;" +
|
||||
" }" +
|
||||
" if (frameDocument != null) {" +
|
||||
" dropDownWorkaround(window, frameDocument);" +
|
||||
" }" +
|
||||
" } catch (error) {" +
|
||||
" console.error(error);" +
|
||||
" }" +
|
||||
" }" +
|
||||
" });" +
|
||||
"})();";
|
||||
|
||||
|
||||
public InAppWebView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
@ -970,16 +526,14 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
super(context, attrs, defaultStyle);
|
||||
}
|
||||
|
||||
public InAppWebView(PluginRegistry.Registrar registrar, Context context, Object obj, int id, InAppWebViewOptions options, View containerView) {
|
||||
public InAppWebView(Context context, Object obj, int id, InAppWebViewOptions options, View containerView) {
|
||||
super(context, containerView);
|
||||
this.registrar = registrar;
|
||||
if (obj instanceof InAppBrowserActivity)
|
||||
this.inAppBrowserActivity = (InAppBrowserActivity) obj;
|
||||
else if (obj instanceof FlutterWebView)
|
||||
this.flutterWebView = (FlutterWebView) obj;
|
||||
this.id = id;
|
||||
this.options = options;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -989,16 +543,13 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
|
||||
public void prepare() {
|
||||
|
||||
final Activity activity = (inAppBrowserActivity != null) ? inAppBrowserActivity : registrar.activity();
|
||||
|
||||
boolean isFromInAppBrowserActivity = inAppBrowserActivity != null;
|
||||
|
||||
//httpClient = new OkHttpClient().newBuilder().cache(new Cache(getContext().getCacheDir(), okHttpClientCacheSize)).build();
|
||||
httpClient = new OkHttpClient().newBuilder().build();
|
||||
|
||||
addJavascriptInterface(new JavaScriptBridgeInterface((isFromInAppBrowserActivity) ? inAppBrowserActivity : flutterWebView), JavaScriptBridgeInterface.name);
|
||||
|
||||
inAppWebViewChromeClient = new InAppWebViewChromeClient((isFromInAppBrowserActivity) ? inAppBrowserActivity : flutterWebView, this.registrar);
|
||||
inAppWebViewChromeClient = new InAppWebViewChromeClient((isFromInAppBrowserActivity) ? inAppBrowserActivity : flutterWebView);
|
||||
setWebChromeClient(inAppWebViewChromeClient);
|
||||
|
||||
inAppWebViewClient = new InAppWebViewClient((isFromInAppBrowserActivity) ? inAppBrowserActivity : flutterWebView);
|
||||
@ -1267,7 +818,7 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
|
||||
public void loadFile(String url, MethodChannel.Result result) {
|
||||
try {
|
||||
url = Util.getUrlAsset(registrar, url);
|
||||
url = Util.getUrlAsset(url);
|
||||
} catch (IOException e) {
|
||||
result.error(LOG_TAG, url + " asset file cannot be found!", e);
|
||||
return;
|
||||
@ -1284,7 +835,7 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
|
||||
public void loadFile(String url, Map<String, String> headers, MethodChannel.Result result) {
|
||||
try {
|
||||
url = Util.getUrlAsset(registrar, url);
|
||||
url = Util.getUrlAsset(url);
|
||||
} catch (IOException e) {
|
||||
result.error(LOG_TAG, url + " asset file cannot be found!", e);
|
||||
return;
|
||||
@ -1632,7 +1183,7 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
scriptToInject = String.format(jsWrapper, jsonSourceString);
|
||||
}
|
||||
final String finalScriptToInject = scriptToInject;
|
||||
( (inAppBrowserActivity != null) ? inAppBrowserActivity : flutterWebView.activity ).runOnUiThread(new Runnable() {
|
||||
post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
||||
@ -1721,9 +1272,8 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
}
|
||||
|
||||
public void startSafeBrowsing(final MethodChannel.Result result) {
|
||||
Activity activity = (inAppBrowserActivity != null) ? inAppBrowserActivity : registrar.activity();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
|
||||
startSafeBrowsing(activity.getApplicationContext(), new ValueCallback<Boolean>() {
|
||||
startSafeBrowsing(getContext(), new ValueCallback<Boolean>() {
|
||||
@Override
|
||||
public void onReceiveValue(Boolean value) {
|
||||
result.success(value);
|
||||
@ -1779,7 +1329,7 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
public void printCurrentPage() {
|
||||
// Get a PrintManager instance
|
||||
PrintManager printManager = (PrintManager) registrar.activity()
|
||||
PrintManager printManager = (PrintManager) Shared.activity.getApplicationContext()
|
||||
.getSystemService(Context.PRINT_SERVICE);
|
||||
|
||||
String jobName = getTitle() + " Document";
|
||||
@ -1793,20 +1343,20 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
}
|
||||
|
||||
public void showDropDownWorkaround(final List<Integer> selectedValues, final List<List<String>> values, final boolean isMultiSelect, final DropDownWorkaroundCallback callback) {
|
||||
FrameLayout layout = new FrameLayout(getContext());
|
||||
FrameLayout layout = new FrameLayout(Shared.activity);
|
||||
|
||||
final List<String> listViewValues = new ArrayList<String>();
|
||||
for(List<String> value : values) {
|
||||
listViewValues.add(value.get(0));
|
||||
}
|
||||
|
||||
ListView listView = new ListView(registrar.activeContext());
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(registrar.activeContext(), (!isMultiSelect) ? android.R.layout.simple_list_item_1 : android.R.layout.simple_list_item_multiple_choice, listViewValues);
|
||||
ListView listView = new ListView(Shared.activity);
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(Shared.activity, (!isMultiSelect) ? android.R.layout.simple_list_item_1 : android.R.layout.simple_list_item_multiple_choice, listViewValues);
|
||||
spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_list_item_multiple_choice);
|
||||
listView.setAdapter(spinnerArrayAdapter);
|
||||
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(registrar.activeContext(), R.style.Theme_AppCompat_Dialog_Alert);
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Shared.activity, R.style.Theme_AppCompat_Dialog_Alert);
|
||||
final AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
final List<String> result = new ArrayList<>();
|
||||
|
@ -2,6 +2,7 @@ package com.pichillilorenzo.flutter_inappwebview.InAppWebView;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
@ -31,6 +32,8 @@ import com.pichillilorenzo.flutter_inappwebview.FlutterWebView;
|
||||
import com.pichillilorenzo.flutter_inappwebview.InAppBrowserActivity;
|
||||
import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin;
|
||||
import com.pichillilorenzo.flutter_inappwebview.R;
|
||||
import com.pichillilorenzo.flutter_inappwebview.Shared;
|
||||
import com.pichillilorenzo.flutter_inappwebview.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -47,7 +50,6 @@ import static android.app.Activity.RESULT_OK;
|
||||
public class InAppWebViewChromeClient extends WebChromeClient implements PluginRegistry.ActivityResultListener {
|
||||
|
||||
protected static final String LOG_TAG = "IABWebChromeClient";
|
||||
private PluginRegistry.Registrar registrar;
|
||||
private FlutterWebView flutterWebView;
|
||||
private InAppBrowserActivity inAppBrowserActivity;
|
||||
private ValueCallback<Uri> mUploadMessage;
|
||||
@ -58,30 +60,31 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
private int mOriginalOrientation;
|
||||
private int mOriginalSystemUiVisibility;
|
||||
|
||||
public InAppWebViewChromeClient(Object obj, PluginRegistry.Registrar registrar) {
|
||||
super();
|
||||
this.registrar = registrar;
|
||||
public InAppWebViewChromeClient(Object obj) {
|
||||
if (obj instanceof InAppBrowserActivity)
|
||||
this.inAppBrowserActivity = (InAppBrowserActivity) obj;
|
||||
else if (obj instanceof FlutterWebView)
|
||||
this.flutterWebView = (FlutterWebView) obj;
|
||||
|
||||
registrar.addActivityResultListener(this);
|
||||
if (Shared.registrar != null)
|
||||
Shared.registrar.addActivityResultListener(this);
|
||||
else
|
||||
Shared.activityPluginBinding.addActivityResultListener(this);
|
||||
}
|
||||
|
||||
public Bitmap getDefaultVideoPoster() {
|
||||
if (mCustomView == null) {
|
||||
return null;
|
||||
}
|
||||
return BitmapFactory.decodeResource(this.registrar.activeContext().getResources(), 2130837573);
|
||||
return BitmapFactory.decodeResource(Shared.activity.getApplicationContext().getResources(), 2130837573);
|
||||
}
|
||||
|
||||
public void onHideCustomView() {
|
||||
View decorView = this.registrar.activity().getWindow().getDecorView();
|
||||
View decorView = Shared.activity.getWindow().getDecorView();
|
||||
((FrameLayout) decorView).removeView(this.mCustomView);
|
||||
this.mCustomView = null;
|
||||
decorView.setSystemUiVisibility(this.mOriginalSystemUiVisibility);
|
||||
this.registrar.activity().setRequestedOrientation(this.mOriginalOrientation);
|
||||
Shared.activity.setRequestedOrientation(this.mOriginalOrientation);
|
||||
this.mCustomViewCallback.onCustomViewHidden();
|
||||
this.mCustomViewCallback = null;
|
||||
}
|
||||
@ -91,10 +94,10 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
onHideCustomView();
|
||||
return;
|
||||
}
|
||||
View decorView = this.registrar.activity().getWindow().getDecorView();
|
||||
View decorView = Shared.activity.getWindow().getDecorView();
|
||||
this.mCustomView = paramView;
|
||||
this.mOriginalSystemUiVisibility = decorView.getSystemUiVisibility();
|
||||
this.mOriginalOrientation = this.registrar.activity().getRequestedOrientation();
|
||||
this.mOriginalOrientation = Shared.activity.getRequestedOrientation();
|
||||
this.mCustomViewCallback = paramCustomViewCallback;
|
||||
this.mCustomView.setBackgroundColor(Color.parseColor("#000000"));
|
||||
((FrameLayout) decorView).addView(this.mCustomView, new FrameLayout.LayoutParams(-1, -1));
|
||||
@ -173,7 +176,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
}
|
||||
};
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(registrar.activeContext(), R.style.Theme_AppCompat_Dialog_Alert);
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Shared.activity, R.style.Theme_AppCompat_Dialog_Alert);
|
||||
alertDialogBuilder.setMessage(alertMessage);
|
||||
if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) {
|
||||
alertDialogBuilder.setPositiveButton(confirmButtonTitle, clickListener);
|
||||
@ -264,7 +267,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
}
|
||||
};
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(registrar.activeContext(), R.style.Theme_AppCompat_Dialog_Alert);
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Shared.activity, R.style.Theme_AppCompat_Dialog_Alert);
|
||||
alertDialogBuilder.setMessage(alertMessage);
|
||||
if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) {
|
||||
alertDialogBuilder.setPositiveButton(confirmButtonTitle, confirmClickListener);
|
||||
@ -381,7 +384,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
}
|
||||
};
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(registrar.activeContext(), R.style.Theme_AppCompat_Dialog_Alert);
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Shared.activity, R.style.Theme_AppCompat_Dialog_Alert);
|
||||
alertDialogBuilder.setMessage(alertMessage);
|
||||
if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) {
|
||||
alertDialogBuilder.setPositiveButton(confirmButtonTitle, confirmClickListener);
|
||||
@ -530,7 +533,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
i.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
i.setType("image/*");
|
||||
((inAppBrowserActivity != null) ? inAppBrowserActivity : flutterWebView.activity).startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE);
|
||||
Shared.activity.startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE);
|
||||
|
||||
}
|
||||
|
||||
@ -540,7 +543,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
i.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
i.setType("*/*");
|
||||
((inAppBrowserActivity != null) ? inAppBrowserActivity : flutterWebView.activity).startActivityForResult(
|
||||
Shared.activity.startActivityForResult(
|
||||
Intent.createChooser(i, "File Browser"),
|
||||
FILECHOOSER_RESULTCODE);
|
||||
}
|
||||
@ -551,7 +554,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
i.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
i.setType("image/*");
|
||||
((inAppBrowserActivity != null) ? inAppBrowserActivity : flutterWebView.activity).startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE);
|
||||
Shared.activity.startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE);
|
||||
|
||||
}
|
||||
|
||||
@ -569,7 +572,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
chooserIntent.putExtra(Intent.EXTRA_INTENT, contentSelectionIntent);
|
||||
chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser");
|
||||
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray);
|
||||
((inAppBrowserActivity != null) ? inAppBrowserActivity : flutterWebView.activity).startActivityForResult(chooserIntent, FILECHOOSER_RESULTCODE);
|
||||
Shared.activity.startActivityForResult(chooserIntent, FILECHOOSER_RESULTCODE);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
|
@ -180,9 +180,6 @@ public class InAppWebViewClient extends WebViewClient {
|
||||
if (webView.options.useOnLoadResource) {
|
||||
js += InAppWebView.resourceObserverJS.replaceAll("[\r\n]+", "");
|
||||
}
|
||||
if (webView.options.dropDownWorkaroundEnabled && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
js += InAppWebView.dropDownWorkaroundJS.replaceAll("[\r\n]+", "");
|
||||
}
|
||||
js += InAppWebView.printJS.replaceAll("[\r\n]+", "");
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
@ -540,7 +537,7 @@ public class InAppWebViewClient extends WebViewClient {
|
||||
String certificatePath = (String) responseMap.get("certificatePath");
|
||||
String certificatePassword = (String) responseMap.get("certificatePassword");
|
||||
String androidKeyStoreType = (String) responseMap.get("androidKeyStoreType");
|
||||
Util.PrivateKeyAndCertificates privateKeyAndCertificates = Util.loadPrivateKeyAndCertificate(webView.registrar, certificatePath, certificatePassword, androidKeyStoreType);
|
||||
Util.PrivateKeyAndCertificates privateKeyAndCertificates = Util.loadPrivateKeyAndCertificate(certificatePath, certificatePassword, androidKeyStoreType);
|
||||
request.proceed(privateKeyAndCertificates.privateKey, privateKeyAndCertificates.certificates);
|
||||
}
|
||||
return;
|
||||
|
@ -83,7 +83,6 @@ public class InAppWebViewOptions extends Options {
|
||||
public Boolean hardwareAcceleration = true;
|
||||
public Boolean supportMultipleWindows = false;
|
||||
public String regexToCancelSubFramesLoading;
|
||||
public Boolean dropDownWorkaroundEnabled = false;
|
||||
|
||||
@Override
|
||||
public Object onParse(Map.Entry<String, Object> pair) {
|
||||
|
@ -1,18 +1,23 @@
|
||||
package com.pichillilorenzo.flutter_inappwebview;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.webkit.ValueCallback;
|
||||
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
|
||||
import io.flutter.plugin.common.BinaryMessenger;
|
||||
import io.flutter.plugin.common.PluginRegistry;
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin;
|
||||
import io.flutter.plugin.platform.PlatformViewRegistry;
|
||||
import io.flutter.view.FlutterView;
|
||||
|
||||
public class InAppWebViewFlutterPlugin implements FlutterPlugin {
|
||||
public PluginRegistry.Registrar registrar;
|
||||
public MethodChannel channel;
|
||||
public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {
|
||||
|
||||
protected static final String LOG_TAG = "InAppWebViewFlutterPlugin";
|
||||
protected static final String LOG_TAG = "InAppWebViewFlutterPL";
|
||||
|
||||
public static InAppBrowser inAppBrowser;
|
||||
public static InAppWebViewStatic inAppWebViewStatic;
|
||||
@ -23,33 +28,32 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin {
|
||||
public InAppWebViewFlutterPlugin() {}
|
||||
|
||||
public static void registerWith(PluginRegistry.Registrar registrar) {
|
||||
inAppBrowser = new InAppBrowser(registrar);
|
||||
|
||||
registrar
|
||||
.platformViewRegistry()
|
||||
.registerViewFactory(
|
||||
"com.pichillilorenzo/flutter_inappwebview", new FlutterWebViewFactory(registrar, registrar.view()));
|
||||
new InAppWebViewStatic(registrar);
|
||||
new MyCookieManager(registrar);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
new CredentialDatabaseHandler(registrar);
|
||||
}
|
||||
final InAppWebViewFlutterPlugin instance = new InAppWebViewFlutterPlugin();
|
||||
Shared.registrar = registrar;
|
||||
instance.onAttachedToEngine(
|
||||
registrar.context(), registrar.messenger(), registrar.activity(), registrar.platformViewRegistry(), registrar.view());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToEngine(FlutterPluginBinding binding) {
|
||||
//BinaryMessenger messenger = binding.getFlutterEngine().getDartExecutor();
|
||||
inAppBrowser = new InAppBrowser(registrar);
|
||||
binding
|
||||
.getFlutterEngine()
|
||||
.getPlatformViewsController()
|
||||
.getRegistry()
|
||||
.registerViewFactory(
|
||||
"com.pichillilorenzo/flutter_inappwebview", new FlutterWebViewFactory(registrar,null));
|
||||
inAppWebViewStatic = new InAppWebViewStatic(registrar);
|
||||
myCookieManager = new MyCookieManager(registrar);
|
||||
Shared.flutterAssets = binding.getFlutterAssets();
|
||||
onAttachedToEngine(
|
||||
binding.getApplicationContext(), binding.getBinaryMessenger(), null, binding.getPlatformViewRegistry(), null);
|
||||
}
|
||||
|
||||
|
||||
private void onAttachedToEngine(Context applicationContext, BinaryMessenger messenger, Activity activity, PlatformViewRegistry platformViewRegistry, FlutterView flutterView) {
|
||||
Shared.applicationContext = applicationContext;
|
||||
Shared.activity = activity;
|
||||
|
||||
inAppBrowser = new InAppBrowser(messenger);
|
||||
|
||||
platformViewRegistry.registerViewFactory(
|
||||
"com.pichillilorenzo/flutter_inappwebview", new FlutterWebViewFactory(messenger, flutterView));
|
||||
inAppWebViewStatic = new InAppWebViewStatic(messenger);
|
||||
myCookieManager = new MyCookieManager(messenger);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
credentialDatabaseHandler = new CredentialDatabaseHandler(registrar);
|
||||
credentialDatabaseHandler = new CredentialDatabaseHandler(messenger);
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,4 +77,28 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin {
|
||||
}
|
||||
uploadMessageArray = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToActivity(ActivityPluginBinding activityPluginBinding) {
|
||||
Shared.activityPluginBinding = activityPluginBinding;
|
||||
Shared.activity = activityPluginBinding.getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromActivityForConfigChanges() {
|
||||
Shared.activityPluginBinding = null;
|
||||
Shared.activity = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReattachedToActivityForConfigChanges(ActivityPluginBinding activityPluginBinding) {
|
||||
Shared.activityPluginBinding = activityPluginBinding;
|
||||
Shared.activity = activityPluginBinding.getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromActivity() {
|
||||
Shared.activityPluginBinding = null;
|
||||
Shared.activity = null;
|
||||
}
|
||||
}
|
||||
|
@ -1,30 +1,26 @@
|
||||
package com.pichillilorenzo.flutter_inappwebview;
|
||||
|
||||
import android.util.Log;
|
||||
import android.webkit.WebSettings;
|
||||
|
||||
import io.flutter.plugin.common.BinaryMessenger;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.flutter.plugin.common.PluginRegistry;
|
||||
|
||||
public class InAppWebViewStatic implements MethodChannel.MethodCallHandler {
|
||||
public PluginRegistry.Registrar registrar;
|
||||
public MethodChannel channel;
|
||||
|
||||
protected static final String LOG_TAG = "InAppWebViewStatic";
|
||||
|
||||
public InAppWebViewStatic(PluginRegistry.Registrar r) {
|
||||
registrar = r;
|
||||
channel = new MethodChannel(registrar.messenger(), "com.pichillilorenzo/flutter_inappwebview_static");
|
||||
public InAppWebViewStatic(BinaryMessenger messenger) {
|
||||
channel = new MethodChannel(messenger, "com.pichillilorenzo/flutter_inappwebview_static");
|
||||
channel.setMethodCallHandler(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMethodCall(MethodCall call, MethodChannel.Result result) {
|
||||
Log.d(LOG_TAG, call.method);
|
||||
switch (call.method) {
|
||||
case "getDefaultUserAgent":
|
||||
result.success(WebSettings.getDefaultUserAgent(registrar.activeContext()));
|
||||
result.success(WebSettings.getDefaultUserAgent(Shared.applicationContext));
|
||||
break;
|
||||
default:
|
||||
result.notImplemented();
|
||||
|
@ -290,7 +290,6 @@ public class JavaScriptBridgeInterface {
|
||||
List<List<String>> values = new ArrayList<>();
|
||||
JSONArray options = jsonArray.getJSONArray(2);
|
||||
|
||||
Log.d(LOG_TAG, options.toString());
|
||||
for(int i = 0; i < options.length(); i++) {
|
||||
JSONObject option = options.getJSONObject(i);
|
||||
|
||||
|
@ -13,6 +13,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import io.flutter.plugin.common.BinaryMessenger;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.flutter.plugin.common.PluginRegistry;
|
||||
@ -21,13 +22,11 @@ public class MyCookieManager implements MethodChannel.MethodCallHandler {
|
||||
|
||||
static final String LOG_TAG = "MyCookieManager";
|
||||
|
||||
public static PluginRegistry.Registrar registrar;
|
||||
public static MethodChannel channel;
|
||||
public static CookieManager cookieManager;
|
||||
|
||||
public MyCookieManager(PluginRegistry.Registrar r) {
|
||||
registrar = r;
|
||||
channel = new MethodChannel(registrar.messenger(), "com.pichillilorenzo/flutter_inappwebview_cookiemanager");
|
||||
public MyCookieManager(BinaryMessenger messenger) {
|
||||
channel = new MethodChannel(messenger, "com.pichillilorenzo/flutter_inappwebview_cookiemanager");
|
||||
channel.setMethodCallHandler(this);
|
||||
cookieManager = CookieManager.getInstance();
|
||||
}
|
||||
@ -110,7 +109,7 @@ public class MyCookieManager implements MethodChannel.MethodCallHandler {
|
||||
cookieManager.flush();
|
||||
}
|
||||
else {
|
||||
CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(registrar.context());
|
||||
CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(Shared.applicationContext);
|
||||
cookieSyncMngr.startSync();
|
||||
cookieManager.setCookie(url, cookieValue);
|
||||
result.success(true);
|
||||
@ -155,7 +154,7 @@ public class MyCookieManager implements MethodChannel.MethodCallHandler {
|
||||
cookieManager.flush();
|
||||
}
|
||||
else {
|
||||
CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(registrar.context());
|
||||
CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(Shared.applicationContext);
|
||||
cookieSyncMngr.startSync();
|
||||
cookieManager.setCookie(url, cookieValue);
|
||||
result.success(true);
|
||||
@ -172,7 +171,7 @@ public class MyCookieManager implements MethodChannel.MethodCallHandler {
|
||||
if (cookiesString != null) {
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
cookieSyncMngr = CookieSyncManager.createInstance(registrar.context());
|
||||
cookieSyncMngr = CookieSyncManager.createInstance(Shared.applicationContext);
|
||||
cookieSyncMngr.startSync();
|
||||
}
|
||||
|
||||
@ -208,7 +207,7 @@ public class MyCookieManager implements MethodChannel.MethodCallHandler {
|
||||
cookieManager.flush();
|
||||
}
|
||||
else {
|
||||
CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(registrar.context());
|
||||
CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(Shared.applicationContext);
|
||||
cookieSyncMngr.startSync();
|
||||
cookieManager.removeAllCookie();
|
||||
result.success(true);
|
||||
|
@ -1,4 +1,16 @@
|
||||
package com.pichillilorenzo.flutter_inappwebview;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin;
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
|
||||
import io.flutter.plugin.common.PluginRegistry;
|
||||
|
||||
public class Shared {
|
||||
public static Context applicationContext;
|
||||
public static PluginRegistry.Registrar registrar;
|
||||
public static FlutterPlugin.FlutterAssets flutterAssets;
|
||||
public static ActivityPluginBinding activityPluginBinding;
|
||||
public static Activity activity;
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.flutter.plugin.common.PluginRegistry;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
public class Util {
|
||||
@ -37,13 +36,13 @@ public class Util {
|
||||
|
||||
private Util() {}
|
||||
|
||||
public static String getUrlAsset(PluginRegistry.Registrar registrar, String assetFilePath) throws IOException {
|
||||
String key = registrar.lookupKeyForAsset(assetFilePath);
|
||||
public static String getUrlAsset(String assetFilePath) throws IOException {
|
||||
String key = (Shared.registrar != null) ? Shared.registrar.lookupKeyForAsset(assetFilePath) : Shared.flutterAssets.getAssetFilePathByName(assetFilePath);
|
||||
InputStream is = null;
|
||||
IOException e = null;
|
||||
|
||||
try {
|
||||
is = getFileAsset(registrar, assetFilePath);
|
||||
is = getFileAsset(assetFilePath);
|
||||
} catch (IOException ex) {
|
||||
e = ex;
|
||||
} finally {
|
||||
@ -62,9 +61,9 @@ public class Util {
|
||||
return ANDROID_ASSET_URL + key;
|
||||
}
|
||||
|
||||
public static InputStream getFileAsset(PluginRegistry.Registrar registrar, String assetFilePath) throws IOException {
|
||||
String key = registrar.lookupKeyForAsset(assetFilePath);
|
||||
AssetManager mg = registrar.activeContext().getResources().getAssets();
|
||||
public static InputStream getFileAsset(String assetFilePath) throws IOException {
|
||||
String key = (Shared.registrar != null) ? Shared.registrar.lookupKeyForAsset(assetFilePath) : Shared.flutterAssets.getAssetFilePathByName(assetFilePath);
|
||||
AssetManager mg = Shared.applicationContext.getResources().getAssets();
|
||||
return mg.open(key);
|
||||
}
|
||||
|
||||
@ -116,12 +115,12 @@ public class Util {
|
||||
}
|
||||
}
|
||||
|
||||
public static PrivateKeyAndCertificates loadPrivateKeyAndCertificate(PluginRegistry.Registrar registrar, String certificatePath, String certificatePassword, String keyStoreType) {
|
||||
public static PrivateKeyAndCertificates loadPrivateKeyAndCertificate( String certificatePath, String certificatePassword, String keyStoreType) {
|
||||
|
||||
PrivateKeyAndCertificates privateKeyAndCertificates = null;
|
||||
|
||||
try {
|
||||
InputStream certificateFileStream = getFileAsset(registrar, certificatePath);
|
||||
InputStream certificateFileStream = getFileAsset(certificatePath);
|
||||
|
||||
KeyStore keyStore = KeyStore.getInstance(keyStoreType);
|
||||
keyStore.load(certificateFileStream, certificatePassword != null ? certificatePassword.toCharArray() : null);
|
||||
|
@ -263,7 +263,7 @@ void main() {
|
||||
|
||||
final sideMenuButton = find.byValueKey('SideMenu');
|
||||
final listTiles = find.byValueKey('ListTiles');
|
||||
final nextTest = find.byValueKey('InAppWebViewOnTargetBlankTest');
|
||||
final nextTest = find.byValueKey('InAppWebViewOnCreateWindowTest');
|
||||
|
||||
while((await driver.getText(appBarTitle)) == "InAppWebViewOnDownloadStartTest") {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
@ -277,14 +277,14 @@ void main() {
|
||||
await driver.tap(nextTest);
|
||||
}, timeout: new Timeout(new Duration(minutes: 5)));
|
||||
|
||||
test('InAppWebViewOnTargetBlankTest', () async {
|
||||
test('InAppWebViewOnCreateWindowTest', () async {
|
||||
final appBarTitle = find.byValueKey('AppBarTitle');
|
||||
|
||||
final sideMenuButton = find.byValueKey('SideMenu');
|
||||
final listTiles = find.byValueKey('ListTiles');
|
||||
final nextTest = find.byValueKey('InAppWebViewOnJsDialogTest');
|
||||
|
||||
while((await driver.getText(appBarTitle)) == "InAppWebViewOnTargetBlankTest") {
|
||||
while((await driver.getText(appBarTitle)) == "InAppWebViewOnCreateWindowTest") {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/example/.dart_tool" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/example/.pub" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/example/build" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappwebview/example/ios/Flutter/App.framework/flutter_assets/packages" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/example/ios/Flutter/App.framework/flutter_assets/packages" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/flutter_inappbrowser_tests/.dart_tool" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/flutter_inappbrowser_tests/.pub" />
|
||||
|
@ -408,14 +408,6 @@ class AndroidInAppWebViewOptions
|
||||
///If the url request of a subframe matches the regular expression, then the request of that subframe is canceled.
|
||||
String regexToCancelSubFramesLoading;
|
||||
|
||||
///Enable a temporary workaround for html dropdowns (`<select>` tags). It requires **JavaScript enabled**.
|
||||
///It attempts to block click events for the dropdowns creating a custom `<div>` layer over the dropdown to intercept user's clicks.
|
||||
///This workaround is applied as soon as the web page fires the `DOMContentLoaded` JavaScript event.
|
||||
///The default value is `false`.
|
||||
///
|
||||
///**NOTE**: available on Android 19+.
|
||||
bool dropDownWorkaroundEnabled;
|
||||
|
||||
AndroidInAppWebViewOptions(
|
||||
{this.textZoom = 100,
|
||||
this.clearSessionCache = false,
|
||||
@ -458,8 +450,7 @@ class AndroidInAppWebViewOptions
|
||||
this.hardwareAcceleration = true,
|
||||
this.initialScale = 0,
|
||||
this.supportMultipleWindows = false,
|
||||
this.regexToCancelSubFramesLoading,
|
||||
this.dropDownWorkaroundEnabled = false});
|
||||
this.regexToCancelSubFramesLoading});
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
@ -505,8 +496,7 @@ class AndroidInAppWebViewOptions
|
||||
"thirdPartyCookiesEnabled": thirdPartyCookiesEnabled,
|
||||
"hardwareAcceleration": hardwareAcceleration,
|
||||
"supportMultipleWindows": supportMultipleWindows,
|
||||
"regexToCancelSubFramesLoading": regexToCancelSubFramesLoading,
|
||||
"dropDownWorkaroundEnabled": dropDownWorkaroundEnabled
|
||||
"regexToCancelSubFramesLoading": regexToCancelSubFramesLoading
|
||||
};
|
||||
}
|
||||
|
||||
@ -561,7 +551,6 @@ class AndroidInAppWebViewOptions
|
||||
options.hardwareAcceleration = map["hardwareAcceleration"];
|
||||
options.supportMultipleWindows = map["supportMultipleWindows"];
|
||||
options.regexToCancelSubFramesLoading = map["regexToCancelSubFramesLoading"];
|
||||
options.dropDownWorkaroundEnabled = map["dropDownWorkaroundEnabled"];
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
@ -92,12 +92,9 @@ appAuthBasic.use((req, res, next) => {
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
appAuthBasic.use(express.static(__dirname + '/public'));
|
||||
appAuthBasic.get('/test-index', (req, res) => {
|
||||
res.sendFile(__dirname + '/public/index.html');
|
||||
});
|
||||
|
||||
appAuthBasic.get("/", (req, res) => {
|
||||
console.log(JSON.stringify(req.headers))
|
||||
@ -111,9 +108,13 @@ appAuthBasic.get("/", (req, res) => {
|
||||
</html>
|
||||
`);
|
||||
res.end()
|
||||
})
|
||||
});
|
||||
|
||||
appAuthBasic.listen(8081)
|
||||
appAuthBasic.get('/test-index', (req, res) => {
|
||||
res.sendFile(__dirname + '/public/test-index.html');
|
||||
});
|
||||
|
||||
appAuthBasic.listen(8081);
|
||||
|
||||
|
||||
|
||||
@ -126,9 +127,6 @@ app.use(cors());
|
||||
app.use(express.json());
|
||||
|
||||
app.use(express.static(__dirname + '/public'));
|
||||
app.get('/test-index', (req, res) => {
|
||||
res.sendFile(__dirname + '/public/index.html');
|
||||
});
|
||||
|
||||
app.get("/", (req, res) => {
|
||||
console.log(JSON.stringify(req.headers))
|
||||
@ -144,6 +142,10 @@ app.get("/", (req, res) => {
|
||||
res.end()
|
||||
})
|
||||
|
||||
app.get('/test-index', (req, res) => {
|
||||
res.sendFile(__dirname + '/public/index.html');
|
||||
})
|
||||
|
||||
app.post("/test-post", (req, res) => {
|
||||
console.log(JSON.stringify(req.headers))
|
||||
console.log(JSON.stringify(req.body))
|
||||
|
@ -1,12 +1,12 @@
|
||||
name: flutter_inappwebview
|
||||
description: A Flutter plugin that allows you to add an inline webview or open an in-app browser window.
|
||||
version: 2.2.0
|
||||
version: 3.0.0
|
||||
author: Lorenzo Pichilli <pichillilorenzo@gmail.com>
|
||||
homepage: https://github.com/pichillilorenzo/flutter_inappwebview
|
||||
|
||||
environment:
|
||||
sdk: ">=2.0.0-dev.68.0 <3.0.0"
|
||||
flutter: ">=1.9.1+hotfix.5 <2.0.0"
|
||||
flutter: ">=1.10.0 <2.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
|
Loading…
x
Reference in New Issue
Block a user