fixed ajax interceptor javascript code, re-added flutterInAppBrowserPlatformReady javascript for the window object, tests moved inside example folder using flutter driver

This commit is contained in:
Lorenzo Pichilli 2019-11-16 12:41:30 +01:00
parent 8894ae1b1e
commit a65909038c
40 changed files with 1455 additions and 683 deletions

View File

@ -15,16 +15,39 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9b41f7a2-a71e-4923-91fb-249d7815b3e7" name="Default" comment=""> <list default="true" id="9b41f7a2-a71e-4923-91fb-249d7815b3e7" name="Default" comment="">
<change afterPath="$PROJECT_DIR$/example/test/custom_widget_test.dart" afterDir="false" /> <change afterPath="$PROJECT_DIR$/example/test_assets/certificate.pfx" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test/in_app_webview_initial_file_test.dart" afterDir="false" /> <change afterPath="$PROJECT_DIR$/example/test_assets/css/style.css" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test/in_app_webview_initial_url_test.dart" afterDir="false" /> <change afterPath="$PROJECT_DIR$/example/test_assets/favicon.ico" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test/in_app_webview_on_load_resource_test.dart" afterDir="false" /> <change afterPath="$PROJECT_DIR$/example/test_assets/images/flutter-logo.svg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test/main_test.dart" afterDir="false" /> <change afterPath="$PROJECT_DIR$/example/test_assets/in_app_webview_ajax_test.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test/util_test.dart" afterDir="false" /> <change afterPath="$PROJECT_DIR$/example/test_assets/in_app_webview_initial_file_test.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_assets/in_app_webview_javascript_handler_test.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_assets/in_app_webview_on_load_resource_test.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_assets/index.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_assets/page-1.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_assets/page-2.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <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$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewClient.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewClient.java" 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$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/JavaScriptBridgeInterface.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/JavaScriptBridgeInterface.java" 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/lib/inline_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/inline_example.screen.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/example/pubspec.yaml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/example/pubspec.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/flutter_inappbrowser.iml" beforeDir="false" afterPath="$PROJECT_DIR$/flutter_inappbrowser.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/custom_widget_test.dart" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_initial_file_test.dart" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_initial_url_test.dart" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_on_load_resource_test.dart" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/ios/Classes/CustomeSchemeHandler.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/CustomeSchemeHandler.swift" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ios/Classes/InAppWebView.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/InAppWebView.swift" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/content_blocker.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/content_blocker.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/in_app_browser.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/in_app_browser.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/in_app_webview.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/in_app_webview.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/types.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/types.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$/tests/flutter_in_app_browser_test/lib/main_test.dart" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/tests/flutter_in_app_browser_test/lib/util_test.dart" beforeDir="false" />
</list> </list>
<ignored path="$PROJECT_DIR$/.dart_tool/" /> <ignored path="$PROJECT_DIR$/.dart_tool/" />
<ignored path="$PROJECT_DIR$/.idea/" /> <ignored path="$PROJECT_DIR$/.idea/" />
@ -44,11 +67,11 @@
<component name="ExecutionTargetManager" SELECTED_TARGET="Pixel_3_XL_API_24" /> <component name="ExecutionTargetManager" SELECTED_TARGET="Pixel_3_XL_API_24" />
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart"> <entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="175"> <state relative-caret-position="237">
<caret line="253" column="38" selection-start-line="253" selection-start-column="38" selection-end-line="253" selection-end-column="38" /> <caret line="158" column="131" selection-start-line="158" selection-start-column="131" selection-end-line="158" selection-end-column="131" />
<folding> <folding>
<element signature="e#0#17#0" expanded="true" /> <element signature="e#0#17#0" expanded="true" />
</folding> </folding>
@ -56,84 +79,6 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/lib/inline_example.screen.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4">
<caret line="90" column="44" selection-start-line="90" selection-start-column="25" selection-end-line="90" selection-end-column="44" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/example/test/in_app_webview_on_load_resource_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="17" column="64" selection-start-line="17" selection-start-column="64" selection-end-line="17" selection-end-column="64" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/test/in_app_webview_initial_file_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="73" selection-start-line="8" selection-start-column="73" selection-end-line="8" selection-end-column="73" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/assets/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="301">
<caret line="39" column="61" selection-start-line="39" selection-start-column="25" selection-end-line="39" selection-end-column="61" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/test/in_app_webview_initial_url_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-260">
<caret line="5" column="33" selection-start-line="5" selection-start-column="33" selection-end-line="5" selection-end-column="33" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/test/util_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="97">
<caret line="35" column="74" selection-start-line="35" selection-start-column="74" selection-end-line="35" selection-end-column="74" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/test/main_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-231">
<caret column="20" selection-start-column="20" selection-end-column="20" />
</state>
</provider>
</entry>
</file>
</leaf> </leaf>
</component> </component>
<component name="FileTemplateManagerImpl"> <component name="FileTemplateManagerImpl">
@ -146,13 +91,6 @@
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>weBVIEWCONTROL</find>
<find>getFa</find>
<find>supportZoom</find>
<find>layou</find>
<find>HttpAuthCredential</find>
<find>layoutA</find>
<find>AndroidInAppWebViewForceDark</find>
<find>AndroidInAppWebViewModeMenuItem</find> <find>AndroidInAppWebViewModeMenuItem</find>
<find>AndroidInAppWebViewMixedContentMode</find> <find>AndroidInAppWebViewMixedContentMode</find>
<find>IosInAppWebViewSelectionGranularity</find> <find>IosInAppWebViewSelectionGranularity</find>
@ -176,6 +114,13 @@
<find>evaluateJ</find> <find>evaluateJ</find>
<find>AjaxRequest</find> <find>AjaxRequest</find>
<find>_onPlatformViewCreated</find> <find>_onPlatformViewCreated</find>
<find>callback</find>
<find>evaluate</find>
<find>onLoadReso</find>
<find>reload</find>
<find>t-rex</find>
<find>ajaxReq</find>
<find>window.</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
<replace>activity.getPreferences(0)</replace> <replace>activity.getPreferences(0)</replace>
@ -191,8 +136,8 @@
</replaceStrings> </replaceStrings>
<dirStrings> <dirStrings>
<dir>$PROJECT_DIR$/example/android</dir> <dir>$PROJECT_DIR$/example/android</dir>
<dir>$PROJECT_DIR$/lib/src</dir>
<dir>$PROJECT_DIR$/lib</dir> <dir>$PROJECT_DIR$/lib</dir>
<dir>$PROJECT_DIR$/lib/src</dir>
</dirStrings> </dirStrings>
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
@ -201,57 +146,57 @@
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/example/assets/page-1.html" />
<option value="$PROJECT_DIR$/example/assets/css/style.css" />
<option value="$PROJECT_DIR$/ios/Classes/InAppWebView.swift" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/android/src/main/AndroidManifest.xml" />
<option value="$PROJECT_DIR$/lib/in_app_browser.dart" />
<option value="$PROJECT_DIR$/lib/src/in_app_localhost_server.dart" />
<option value="$PROJECT_DIR$/lib/src/web_history.dart" />
<option value="$PROJECT_DIR$/example/ios/Runner/Info.plist" />
<option value="$PROJECT_DIR$/lib/src/credentials_database.dart" />
<option value="$PROJECT_DIR$/lib/flutter_inappbrowser.dart" />
<option value="$PROJECT_DIR$/lib/src/channel_manager.dart" />
<option value="$PROJECT_DIR$/android/build.gradle" />
<option value="$PROJECT_DIR$/lib/t_rex_runner/index.js" />
<option value="$PROJECT_DIR$/lib/t_rex_runner/index.css" />
<option value="$PROJECT_DIR$/lib/t_rex_runner/index.html" />
<option value="$PROJECT_DIR$/lib/t_rex_runner/t-rex.html" />
<option value="$PROJECT_DIR$/lib/t_rex_runner/t-rex.css" />
<option value="$PROJECT_DIR$/example/lib/test.dart" />
<option value="$PROJECT_DIR$/ios/flutter_inappbrowser.podspec" />
<option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" />
<option value="$PROJECT_DIR$/lib/src/webview_options.dart" />
<option value="$PROJECT_DIR$/lib/src/content_blocker.dart" />
<option value="$PROJECT_DIR$/lib/src/http_auth_credentials_database.dart" />
<option value="$PROJECT_DIR$/lib/src/cookie_manager.dart" />
<option value="$PROJECT_DIR$/lib/src/chrome_safari_browser.dart" />
<option value="$PROJECT_DIR$/example/lib/chrome_safari_example.screen.dart" />
<option value="$PROJECT_DIR$/lib/src/in_app_browser.dart" />
<option value="$PROJECT_DIR$/example/lib/webview_example.screen.dart" />
<option value="$PROJECT_DIR$/lib/src/types.dart" />
<option value="$PROJECT_DIR$/example/assets/index.html" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/example/lib/main.dart" />
<option value="$PROJECT_DIR$/tests/in_app_weview_widget.dart" />
<option value="$PROJECT_DIR$/tests/in_app_webview_widget.dart" />
<option value="$PROJECT_DIR$/tests/in_app_webview_test.dart" />
<option value="$PROJECT_DIR$/lib/src/in_app_webview.dart" />
<option value="$PROJECT_DIR$/example/lib/inline_example.screen.dart" />
<option value="$PROJECT_DIR$/test/in_app_webview_test.dart" />
<option value="$PROJECT_DIR$/test/in_app_webview_initial_url.dart" />
<option value="$PROJECT_DIR$/test/in_app_webview_initial_url_test.dart" />
<option value="$PROJECT_DIR$/test/main_test.dart" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/example/test/custom_widget_test.dart" /> <option value="$PROJECT_DIR$/example/test/custom_widget_test.dart" />
<option value="$PROJECT_DIR$/example/test/custom_assert.dart" /> <option value="$PROJECT_DIR$/example/test/custom_assert.dart" />
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
<option value="$PROJECT_DIR$/example/test/main_test.dart" /> <option value="$PROJECT_DIR$/example/test/main_test.dart" />
<option value="$PROJECT_DIR$/example/test/in_app_webview_initial_url_test.dart" /> <option value="$PROJECT_DIR$/example/test/in_app_webview_initial_url_test.dart" />
<option value="$PROJECT_DIR$/example/test/in_app_webview_initial_file_test.dart" /> <option value="$PROJECT_DIR$/example/test/in_app_webview_initial_file_test.dart" />
<option value="$PROJECT_DIR$/example/test/util_test.dart" /> <option value="$PROJECT_DIR$/example/test/util_test.dart" />
<option value="$PROJECT_DIR$/example/test/in_app_webview_on_load_resource_test.dart" /> <option value="$PROJECT_DIR$/example/test/in_app_webview_on_load_resource_test.dart" />
<option value="$PROJECT_DIR$/test/pubspec.yaml" />
<option value="$PROJECT_DIR$/test/lib/util_test.dart" />
<option value="$PROJECT_DIR$/test/lib/main_test.dart" />
<option value="$PROJECT_DIR$/test1/lib/main_test.dart" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/android/app/build.gradle" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/util_test.dart" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/android/app/src/main/AndroidManifest.xml" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/assets/in_app_webview_initial_file_test.html" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/assets/in_app_webview_on_load_resource_test.html" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/assets/in_app_webview_javascript_handler_test.html" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/assets/index.html" />
<option value="$PROJECT_DIR$/example/assets/index.html" />
<option value="$PROJECT_DIR$/lib/src/types.dart" />
<option value="$PROJECT_DIR$/lib/src/content_blocker.dart" />
<option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/custom_widget_test.dart" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/ios/Runner/Info.plist" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_javascript_handler_test.dart" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_initial_file_test.dart" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_initial_url_test.dart" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_on_load_resource_test.dart" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/assets/in_app_webview_ajax_test.html" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/main_test.dart" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/pubspec.yaml" />
<option value="$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_ajax_test.dart" />
<option value="$PROJECT_DIR$/test_driver/app.dart" />
<option value="$PROJECT_DIR$/test_driver/app_test.dart" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/example/lib/inline_example.screen.dart" />
<option value="$PROJECT_DIR$/example/test_driver/streamController.dart" />
<option value="$PROJECT_DIR$/example/test_driver/app.dart" />
<option value="$PROJECT_DIR$/example/test_driver/main_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_ajax_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/custom_widget_test.dart" />
<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_load_resource_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/util_test.dart" />
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
<option value="$PROJECT_DIR$/example/test_driver/app_test.dart" />
<option value="$PROJECT_DIR$/lib/src/in_app_browser.dart" />
<option value="$PROJECT_DIR$/lib/src/in_app_webview.dart" />
</list> </list>
</option> </option>
</component> </component>
@ -266,6 +211,27 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope"> <pane id="Scope">
<subPane subId="Project Files"> <subPane subId="Project Files">
<expand> <expand>
@ -306,50 +272,6 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
<item name="assets" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
<item name="test" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -361,27 +283,27 @@
<property name="android.project.structure.proportion" value="0.15" /> <property name="android.project.structure.proportion" value="0.15" />
<property name="dart.analysis.tool.window.force.activate" value="false" /> <property name="dart.analysis.tool.window.force.activate" value="false" />
<property name="io.flutter.reload.alreadyRun" value="true" /> <property name="io.flutter.reload.alreadyRun" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/example/test" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/example/test_assets" />
<property name="project.structure.last.edited" value="Project" /> <property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.15" /> <property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" /> <property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="preferences.externalTools" /> <property name="settings.editor.selected.configurable" value="project.propVCSSupport.Mappings" />
<property name="show.migrate.to.gradle.popup" value="false" /> <property name="show.migrate.to.gradle.popup" value="false" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/example/test_assets" />
<recent name="$PROJECT_DIR$/test_driver" />
<recent name="$PROJECT_DIR$/flutter_inappbrowser_tests/lib" />
<recent name="$PROJECT_DIR$/flutter_inappbrowser_tests/assets" />
<recent name="$PROJECT_DIR$/flutter_inappbrowser_tests" />
</key>
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/flutter_inappbrowser_tests/assets" />
<recent name="$PROJECT_DIR$/example" /> <recent name="$PROJECT_DIR$/example" />
<recent name="$PROJECT_DIR$/example/lib" /> <recent name="$PROJECT_DIR$/example/lib" />
<recent name="$PROJECT_DIR$/lib" /> <recent name="$PROJECT_DIR$/lib" />
<recent name="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/assets" /> <recent name="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/assets" />
<recent name="$PROJECT_DIR$/example/assets" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/example/test" />
<recent name="$PROJECT_DIR$/example/assets" />
<recent name="$PROJECT_DIR$" />
<recent name="$PROJECT_DIR$/example" />
<recent name="$PROJECT_DIR$/example/assets/images" />
</key> </key>
</component> </component>
<component name="RunDashboard"> <component name="RunDashboard">
@ -497,7 +419,7 @@
<frame x="0" y="23" width="1920" height="1057" extended-state="6" /> <frame x="0" y="23" width="1920" height="1057" extended-state="6" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.6529745" visible="true" weight="0.15867944" /> <window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.6529745" visible="true" weight="0.21991481" />
<window_info id="Structure" order="1" sideWeight="0.34702548" side_tool="true" weight="0.15867944" /> <window_info id="Structure" order="1" sideWeight="0.34702548" side_tool="true" weight="0.15867944" />
<window_info id="Designer" order="2" /> <window_info id="Designer" order="2" />
<window_info id="Build Variants" order="3" side_tool="true" /> <window_info id="Build Variants" order="3" side_tool="true" />
@ -508,7 +430,7 @@
<window_info id="Resources Explorer" order="8" /> <window_info id="Resources Explorer" order="8" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32642487" /> <window_info anchor="bottom" id="Find" order="1" weight="0.32642487" />
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49574015" weight="0.6279793" /> <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49574015" weight="0.43523315" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.34196892" /> <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="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" /> <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@ -516,8 +438,8 @@
<window_info anchor="bottom" id="Android Profiler" order="7" show_stripe_button="false" /> <window_info anchor="bottom" id="Android Profiler" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.50692225" side_tool="true" weight="0.38445595" /> <window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.50692225" side_tool="true" weight="0.38445595" />
<window_info anchor="bottom" id="Version Control" order="9" weight="0.32953367" /> <window_info anchor="bottom" id="Version Control" order="9" weight="0.32953367" />
<window_info active="true" anchor="bottom" id="Terminal" order="10" sideWeight="0.49533224" visible="true" weight="0.54300517" /> <window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.49533224" weight="0.3388601" />
<window_info anchor="bottom" id="Messages" order="11" weight="0.3896373" /> <window_info anchor="bottom" id="Messages" order="11" visible="true" weight="0.3896373" />
<window_info anchor="bottom" id="Dependency Viewer" order="12" weight="0.32800853" /> <window_info anchor="bottom" id="Dependency Viewer" order="12" weight="0.32800853" />
<window_info anchor="bottom" id="Logcat" order="13" weight="0.32953367" /> <window_info anchor="bottom" id="Logcat" order="13" weight="0.32953367" />
<window_info anchor="bottom" id="Dart Analysis" order="14" sideWeight="0.4968051" weight="0.3253886" /> <window_info anchor="bottom" id="Dart Analysis" order="14" sideWeight="0.4968051" weight="0.3253886" />
@ -543,343 +465,244 @@
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<ignored-roots> <ignored-roots>
<path value="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser" /> <path value="$PROJECT_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser" />
<path value="$PROJECT_DIR$/flutter_inappbrowser_tests/ios/.symlinks/plugins/flutter_inappbrowser" />
</ignored-roots> </ignored-roots>
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$USER_HOME$/flutter/bin/cache/pkg/sky_engine/lib/io/file.dart"> <entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/assets/in_app_webview_on_load_resource_test.html" />
<provider selected="true" editor-type-id="text-editor"> <entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/assets/page-1.html" />
<state relative-caret-position="-1206">
<caret line="251" column="10" selection-start-line="251" selection-start-column="10" selection-end-line="251" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/flutter/packages/flutter/lib/src/services/asset_bundle.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15">
<caret line="65" column="17" selection-start-line="65" selection-start-column="17" selection-end-line="65" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/novas-coisas.gif" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/t-rex-runner-19janil.gif" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/t-rex-runner-bot.gif" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/hello-kugou.gif" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/kumamon-runner.gif" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/screenshot.gif" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/default_200_percent/200-offline-sprite.png" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/default_200_percent/200-error-offline.png" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/default_200_percent/200-disabled.png" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/offline-sprite-2x.png" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/assets/offline-sprite-1x.png" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/index.css" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/index.js" />
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/t-rex.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225">
<caret line="15" column="38" selection-start-line="15" selection-start-column="38" selection-end-line="15" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/t_rex_runner/t-rex.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="885">
<caret line="59" selection-start-line="59" selection-end-line="59" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/flutter/bin/cache/dart-sdk/lib/collection/linked_hash_map.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="137">
<caret line="88" column="12" selection-start-line="88" selection-start-column="12" selection-end-line="88" selection-end-column="12" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/build/app/outputs/apk/debug/output.json">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser.iml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="298">
<caret line="127" column="53" selection-start-line="127" selection-start-column="37" selection-end-line="127" selection-end-column="53" />
<folding>
<element signature="e#12489#12509#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ios/flutter_inappbrowser.podspec">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300">
<caret line="20" column="25" selection-start-line="20" selection-start-column="25" selection-end-line="20" selection-end-column="25" />
</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="613">
<caret line="128" selection-start-line="128" selection-end-line="128" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/chrome_safari_browser.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="24" column="32" selection-start-line="24" selection-start-column="32" selection-end-line="24" selection-end-column="32" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/webview_example.screen.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="528">
<caret line="118" column="43" lean-forward="true" selection-start-line="118" selection-start-column="43" selection-end-line="118" selection-end-column="43" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</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="240">
<caret line="501" column="27" selection-start-line="501" selection-start-column="27" selection-end-line="501" selection-end-column="27" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</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="1136">
<caret line="87" column="84" selection-start-line="87" selection-start-column="84" selection-end-line="87" selection-end-column="84" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/content_blocker.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225">
<caret line="15" column="28" selection-start-line="15" selection-start-column="17" selection-end-line="15" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/chrome_safari_example.screen.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="570">
<caret line="38" column="43" selection-start-line="38" selection-start-column="43" selection-end-line="38" selection-end-column="43" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/in_app_localhost_server.dart">
<provider selected="true" editor-type-id="text-editor">
<state>
<folding>
<element signature="e#0#17#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="-4314">
<caret line="363" column="36" selection-start-line="363" selection-start-column="36" selection-end-line="363" selection-end-column="36" />
<folding>
<element signature="e#0#17#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="13980">
<caret line="939" column="17" selection-start-line="939" selection-start-column="6" selection-end-line="939" selection-end-column="17" />
<folding>
<element signature="e#0#20#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="1905">
<caret line="127" column="25" selection-start-line="127" selection-start-column="10" selection-end-line="127" selection-end-column="25" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md"> <entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="660"> <state relative-caret-position="440">
<caret line="44" column="52" selection-start-line="44" selection-start-column="52" selection-end-line="44" selection-end-column="52" /> <caret line="47" selection-start-line="47" selection-end-line="47" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tests/in_app_webview_widget.dart"> <entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/assets/in_app_webview_javascript_handler_test.html" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/assets/index.html" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/lib/util_test.dart" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/lib/custom_widget_test.dart" />
<entry file="file://$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="480"> <state relative-caret-position="1995">
<caret line="32" column="29" selection-start-line="32" selection-start-column="29" selection-end-line="32" selection-end-column="29" /> <caret line="133" column="35" selection-start-line="133" selection-start-column="35" selection-end-line="133" selection-end-column="35" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$USER_HOME$/flutter/bin/cache/pkg/sky_engine/lib/core/print.dart"> <entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/ios/Runner/GeneratedPluginRegistrant.m" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/ios/Runner/AppDelegate.swift" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/ios/Podfile" />
<entry file="file://$PROJECT_DIR$/example/ios/Runner/Info.plist">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90"> <state relative-caret-position="360">
<caret line="8" column="5" selection-start-line="8" selection-start-column="5" selection-end-line="8" selection-end-column="5" /> <caret line="45" column="9" selection-start-line="44" selection-start-column="2" selection-end-line="45" selection-end-column="9" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tests/in_app_webview_test.dart"> <entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/ios/Runner/Info.plist" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_initial_url_test.dart" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_on_load_resource_test.dart" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_initial_file_test.dart" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_javascript_handler_test.dart" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/lib/main_test.dart" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/assets/in_app_webview_ajax_test.html" />
<entry file="file://$PROJECT_DIR$/lib/src/types.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="750"> <state relative-caret-position="17160">
<caret line="50" column="33" selection-start-line="50" selection-start-column="7" selection-end-line="50" selection-end-column="33" /> <caret line="1151" column="38" selection-start-line="1151" selection-start-column="38" selection-end-line="1151" selection-end-column="38" />
<folding>
<element signature="e#0#25#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="-55">
<caret line="16" column="42" lean-forward="true" selection-start-line="16" selection-start-column="42" selection-end-line="16" selection-end-column="42" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="69">
<caret line="12" column="32" selection-start-line="12" selection-start-column="32" selection-end-line="12" selection-end-column="32" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/test_driver/custom_widget_test.dart" />
<entry file="file://$PROJECT_DIR$/test_driver/main_test.dart" />
<entry file="file://$PROJECT_DIR$/test_driver/app.dart" />
<entry file="file://$PROJECT_DIR$/test_driver/app_test.dart" />
<entry file="file://$PROJECT_DIR$/pubspec.yaml"> <entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="9"> <state relative-caret-position="216">
<caret line="25" lean-forward="true" selection-start-line="25" selection-end-line="25" /> <caret line="15" column="17" selection-start-line="15" selection-start-column="17" selection-end-line="15" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_assets/css/style.css">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/pubspec.yaml" />
<entry file="file://$PROJECT_DIR$/flutter_inappbrowser_tests/lib/in_app_webview_ajax_test.dart" />
<entry file="file://$PROJECT_DIR$/lib/src/content_blocker.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="102">
<caret line="184" column="22" lean-forward="true" selection-start-line="184" selection-start-column="22" selection-end-line="184" selection-end-column="22" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/lib/inline_example.screen.dart"> <entry file="file://$PROJECT_DIR$/example/lib/inline_example.screen.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4"> <state relative-caret-position="501">
<caret line="90" column="44" selection-start-line="90" selection-start-column="25" selection-end-line="90" selection-end-column="44" /> <caret line="103" column="41" selection-start-line="103" selection-start-column="41" selection-end-line="103" selection-end-column="41" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#20#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/.flutter-plugins">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$USER_HOME$/flutter/packages/flutter_driver/lib/src/driver/driver.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2475">
<caret line="193" column="8" selection-start-line="193" selection-start-column="8" selection-end-line="193" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/flutter/bin/cache/pkg/sky_engine/lib/async/stream.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="280">
<caret line="1243" column="16" selection-start-line="1243" selection-start-column="16" selection-end-line="1243" selection-end-column="16" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.5/lib/src/frontend/expect.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
<caret line="53" column="5" selection-start-line="53" selection-start-column="5" selection-end-line="53" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/streamController.dart" />
<entry file="file://$PROJECT_DIR$/example/test_driver/app.dart">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="54" lean-forward="true" selection-start-column="54" selection-end-column="54" />
</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" />
</entry>
<entry file="file://$PROJECT_DIR$/example/assets/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="547">
<caret line="98" column="15" selection-start-line="96" selection-start-column="12" selection-end-line="98" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_on_load_resource_test.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_ajax_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" column="70" selection-start-line="9" selection-start-column="70" selection-end-line="9" selection-end-column="70" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/custom_widget_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="7" column="41" selection-start-line="7" selection-start-column="41" selection-end-line="7" selection-end-column="41" />
<folding>
<element signature="e#0#38#0" expanded="true" />
</folding>
</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="150">
<caret line="10" selection-start-line="10" selection-end-line="10" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_javascript_handler_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360">
<caret line="24" column="2" selection-start-line="24" selection-start-column="2" selection-end-line="24" selection-end-column="2" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150">
<caret line="10" selection-start-line="10" selection-end-line="10" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150">
<caret line="10" column="2" selection-start-line="10" selection-start-column="2" selection-end-line="10" selection-end-column="2" />
<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="82">
<caret line="13" column="12" selection-start-line="13" selection-start-column="6" selection-end-line="13" selection-end-column="12" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/app_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-876">
<caret line="11" column="4" selection-start-line="11" selection-start-column="4" selection-end-line="11" selection-end-column="4" />
<folding>
<element signature="e#35#55#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/util_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="7" selection-start-line="7" selection-end-line="7" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_assets/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1678" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="130">
<caret line="23" column="28" selection-start-line="23" selection-start-column="28" selection-end-line="23" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart"> <entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="175"> <state relative-caret-position="237">
<caret line="253" column="38" selection-start-line="253" selection-start-column="38" selection-end-line="253" selection-end-column="38" /> <caret line="158" column="131" selection-start-line="158" selection-start-column="131" selection-end-line="158" selection-end-column="131" />
<folding> <folding>
<element signature="e#0#17#0" expanded="true" /> <element signature="e#0#17#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/assets/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="301">
<caret line="39" column="61" selection-start-line="39" selection-start-column="25" selection-end-line="39" selection-end-column="61" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test/custom_widget_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150">
<caret line="10" column="16" selection-start-line="10" selection-start-column="16" selection-end-line="10" selection-end-column="16" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state>
<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://$USER_HOME$/flutter/.pub-cache/hosted/pub.dartlang.org/ansicolor-1.0.2/lib/ansicolor.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="277">
<caret line="65" column="7" selection-start-line="65" selection-start-column="7" selection-end-line="65" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test/in_app_webview_initial_url_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-260">
<caret line="5" column="33" selection-start-line="5" selection-start-column="33" selection-end-line="5" selection-end-column="33" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test/main_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-231">
<caret column="20" selection-start-column="20" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test/util_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="97">
<caret line="35" column="74" selection-start-line="35" selection-start-column="74" selection-end-line="35" selection-end-column="74" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test/in_app_webview_initial_file_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="73" selection-start-line="8" selection-start-column="73" selection-end-line="8" selection-end-column="73" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test/in_app_webview_on_load_resource_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="17" column="64" selection-start-line="17" selection-start-column="64" selection-end-line="17" selection-end-column="64" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component> </component>
<component name="masterDetails"> <component name="masterDetails">
<states> <states>

View File

@ -45,7 +45,6 @@
- Renamed `injectScriptCode` to `evaluateJavascript` - Renamed `injectScriptCode` to `evaluateJavascript`
- Renamed `injectStyleCode` to `injectCSSCode` - Renamed `injectStyleCode` to `injectCSSCode`
- Renamed `injectStyleFile` to `injectCSSFileFromUrl` - Renamed `injectStyleFile` to `injectCSSFileFromUrl`
- No need to listen to `window.addEventListener("flutterInAppBrowserPlatformReady", fuction(){ })` javascript event anymore to call `window.flutter_inappbrowser.callHandler(handlerName <String>, ...args)` to use the JavaScript message handlers
## 1.2.1 ## 1.2.1

View File

@ -85,6 +85,8 @@ final public class InAppWebView extends InputAwareWebView {
" }" + " }" +
"})(window.console);"; "})(window.console);";
static final String platformReadyJS = "window.dispatchEvent(new Event('flutterInAppBrowserPlatformReady'));";
static final String variableForOnLoadResourceJS = "window._flutter_inappbrowser_useOnLoadResource"; static final String variableForOnLoadResourceJS = "window._flutter_inappbrowser_useOnLoadResource";
static final String enableVariableForOnLoadResourceJS = variableForOnLoadResourceJS + " = $PLACEHOLDER_VALUE;"; static final String enableVariableForOnLoadResourceJS = variableForOnLoadResourceJS + " = $PLACEHOLDER_VALUE;";
@ -148,7 +150,6 @@ final public class InAppWebView extends InputAwareWebView {
" };" + " };" +
" ajax.prototype.setRequestHeader = function(header, value) {" + " ajax.prototype.setRequestHeader = function(header, value) {" +
" this._flutter_inappbrowser_request_headers[header] = value;" + " this._flutter_inappbrowser_request_headers[header] = value;" +
" setRequestHeader.call(this, header, value);" +
" };" + " };" +
" function handleEvent(e) {" + " function handleEvent(e) {" +
" var self = this;" + " var self = this;" +
@ -289,7 +290,11 @@ final public class InAppWebView extends InputAwareWebView {
" };" + " };" +
" for (var header in result.headers) {" + " for (var header in result.headers) {" +
" var value = result.headers[header];" + " var value = result.headers[header];" +
" self.setRequestHeader(header, value);" + " self._flutter_inappbrowser_request_headers[header] = value;" +
" };" +
" for (var header in self._flutter_inappbrowser_request_headers) {" +
" var value = self._flutter_inappbrowser_request_headers[header];" +
" setRequestHeader.call(self, header, value);" +
" };" + " };" +
" if ((self._flutter_inappbrowser_method != result.method && result.method != null) || (self._flutter_inappbrowser_url != result.url && result.url != null)) {" + " if ((self._flutter_inappbrowser_method != result.method && result.method != null) || (self._flutter_inappbrowser_url != result.url && result.url != null)) {" +
" self.abort();" + " self.abort();" +

View File

@ -136,16 +136,23 @@ public class InAppWebViewClient extends WebViewClient {
InAppWebView webView = (InAppWebView) view; InAppWebView webView = (InAppWebView) view;
webView.loadUrl("javascript:" + InAppWebView.consoleLogJS.replaceAll("[\r\n]+", "")); String js = InAppWebView.consoleLogJS.replaceAll("[\r\n]+", "");
webView.loadUrl("javascript:" + JavaScriptBridgeInterface.flutterInAppBroserJSClass.replaceAll("[\r\n]+", "")); js += JavaScriptBridgeInterface.flutterInAppBroserJSClass.replaceAll("[\r\n]+", "");
if (webView.options.useShouldInterceptAjaxRequest) { if (webView.options.useShouldInterceptAjaxRequest) {
webView.loadUrl("javascript:" + InAppWebView.interceptAjaxRequestsJS.replaceAll("[\r\n]+", "")); js += InAppWebView.interceptAjaxRequestsJS.replaceAll("[\r\n]+", "");
} }
if (webView.options.useShouldInterceptFetchRequest) { if (webView.options.useShouldInterceptFetchRequest) {
webView.loadUrl("javascript:" + InAppWebView.interceptFetchRequestsJS.replaceAll("[\r\n]+", "")); js += InAppWebView.interceptFetchRequestsJS.replaceAll("[\r\n]+", "");
} }
if (webView.options.useOnLoadResource) { if (webView.options.useOnLoadResource) {
webView.loadUrl("javascript:" + InAppWebView.resourceObserverJS.replaceAll("[\r\n]+", "")); js += InAppWebView.resourceObserverJS.replaceAll("[\r\n]+", "");
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
webView.evaluateJavascript(js, (ValueCallback<String>) null);
} else {
webView.loadUrl("javascript:" + js);
} }
onPageStartedURL = url; onPageStartedURL = url;
@ -184,6 +191,14 @@ public class InAppWebViewClient extends WebViewClient {
view.clearFocus(); view.clearFocus();
view.requestFocus(); view.requestFocus();
String js = InAppWebView.platformReadyJS.replaceAll("[\r\n]+", "");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
webView.evaluateJavascript(js, (ValueCallback<String>) null);
} else {
webView.loadUrl("javascript:" + js);
}
Map<String, Object> obj = new HashMap<>(); Map<String, Object> obj = new HashMap<>();
if (inAppBrowserActivity != null) if (inAppBrowserActivity != null)
obj.put("uuid", inAppBrowserActivity.uuid); obj.put("uuid", inAppBrowserActivity.uuid);

View File

@ -28,7 +28,7 @@ public class JavaScriptBridgeInterface {
"return new Promise(function(resolve, reject) {" + "return new Promise(function(resolve, reject) {" +
" window." + name + "[_callHandlerID] = resolve;" + " window." + name + "[_callHandlerID] = resolve;" +
"});" + "});" +
"}"; "};";
public JavaScriptBridgeInterface(Object obj) { public JavaScriptBridgeInterface(Object obj) {
if (obj instanceof InAppBrowserActivity) if (obj instanceof InAppBrowserActivity)

View File

@ -77,14 +77,16 @@
window.location = "#foo-" + randomNumber; window.location = "#foo-" + randomNumber;
} }
window.flutter_inappbrowser.callHandler('handlerFoo').then(function(result) { window.addEventListener("flutterInAppBrowserPlatformReady", function(event) {
console.log(result, typeof result); window.flutter_inappbrowser.callHandler('handlerFoo').then(function(result) {
console.log(JSON.stringify(result), result.bar); console.log(result, typeof result);
}); console.log(JSON.stringify(result), result.bar);
});
window.flutter_inappbrowser.callHandler('handlerFooWithArgs', 1, true, ['bar', 5], {foo: 'baz'}).then(function(result) { window.flutter_inappbrowser.callHandler('handlerFooWithArgs', 1, true, ['bar', 5], {foo: 'baz'}).then(function(result) {
console.log(result, typeof result); console.log(result, typeof result);
console.log(JSON.stringify(result)); console.log(JSON.stringify(result));
});
}); });
$(document).ready(function() { $(document).ready(function() {

View File

@ -289,9 +289,10 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> {
print("Current highlighted: $activeMatchOrdinal, Number of matches found: $numberOfMatches, find operation completed: $isDoneCounting"); print("Current highlighted: $activeMatchOrdinal, Number of matches found: $numberOfMatches, find operation completed: $isDoneCounting");
}, },
shouldInterceptAjaxRequest: (InAppWebViewController controller, AjaxRequest ajaxRequest) async { shouldInterceptAjaxRequest: (InAppWebViewController controller, AjaxRequest ajaxRequest) async {
print("AJAX REQUEST: ${ajaxRequest.method} - ${ajaxRequest.url}, DATA: ${ajaxRequest.data}"); print("AJAX REQUEST: ${ajaxRequest.method} - ${ajaxRequest.url}, DATA: ${ajaxRequest.data}, headers: ${ajaxRequest.headers}");
if (ajaxRequest.url == "http://192.168.1.20:8082/test-ajax-post") { if (ajaxRequest.url == "http://192.168.1.20:8082/test-ajax-post") {
ajaxRequest.responseType = 'json'; ajaxRequest.responseType = 'json';
ajaxRequest.data = "firstname=Lorenzo&lastname=Pichilli";
} }
// ajaxRequest.method = "GET"; // ajaxRequest.method = "GET";
// ajaxRequest.url = "http://192.168.1.20:8082/test-download-file"; // ajaxRequest.url = "http://192.168.1.20:8082/test-download-file";

View File

@ -22,14 +22,13 @@ dependencies:
flutter_downloader: ^1.3.2 flutter_downloader: ^1.3.2
path_provider: ^1.4.0 path_provider: ^1.4.0
permission_handler: ^3.3.0 permission_handler: ^3.3.0
flutter_inappbrowser:
path: ../
dev_dependencies: dev_dependencies:
flutter_test: flutter_driver:
sdk: flutter sdk: flutter
ansicolor: 1.0.2 test: any
flutter_inappbrowser:
path: ../
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec # following page: https://www.dartlang.org/tools/pub/pubspec
@ -50,6 +49,14 @@ flutter:
- assets/css/ - assets/css/
- assets/images/ - assets/images/
- assets/favicon.ico - assets/favicon.ico
- test_assets/certificate.pfx
- test_assets/in_app_webview_initial_file_test.html
- test_assets/in_app_webview_on_load_resource_test.html
- test_assets/in_app_webview_javascript_handler_test.html
- test_assets/in_app_webview_ajax_test.html
- test_assets/css/
- test_assets/images/
- test_assets/favicon.ico
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
# assets: # assets:

View File

@ -1,18 +0,0 @@
import 'package:ansicolor/ansicolor.dart';
import 'package:flutter/widgets.dart';
class WidgetTest extends StatefulWidget {
final String name;
WidgetTest({this.name, Key key}): super(key: key) {
AnsiPen pen = new AnsiPen()..white()..rgb(r: 1.0, g: 0.8, b: 0.2);
print("\n");
print(pen("'" + this.name + "' test loading..."));
print("\n");
}
@override
State<StatefulWidget> createState() {
return null;
}
}

View File

@ -1,43 +0,0 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'in_app_webview_initial_file_test.dart';
import 'in_app_webview_initial_url_test.dart';
import 'in_app_webview_on_load_resource_test.dart';
Future main() async {
runApp(new MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'flutter_inappbrowser tests',
initialRoute: '/',
routes: {
'/': (context) => InAppWebViewInitialUrlTest(),
'/InAppWebViewInitialFileTest': (context) => InAppWebViewInitialFileTest(),
'/InAppWebViewOnLoadResourceTest': (context) => InAppWebViewOnLoadResourceTest()
}
);
}
}

View File

@ -1,60 +0,0 @@
import 'package:ansicolor/ansicolor.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'custom_widget_test.dart';
int countTestPassed = 0;
int countTestFailed = 0;
int currentTest = 0;
List<String> testRoutes = [
'/',
'/InAppWebViewInitialFileTest',
'/InAppWebViewOnLoadResourceTest'
];
void nextTest({@required BuildContext context}) {
if (currentTest + 1 < testRoutes.length) {
currentTest++;
String nextRoute = testRoutes[currentTest];
Navigator.pushReplacementNamed(context, nextRoute);
} else {
AnsiPen penError = new AnsiPen()..white()..rgb(r: 1.0, g: 0.0, b: 0.0);
AnsiPen penSuccess = new AnsiPen()..white()..rgb(r: 0.0, g: 1.0, b: 0.0);
if (countTestFailed > 0)
print("\n" + penError("Total tests failed $countTestFailed.") + "\n");
if (countTestPassed > 0)
print("\n" + penSuccess("Total tests passed $countTestPassed.") + "\n");
}
}
bool customAssert({WidgetTest widget, String name, @required bool value}) {
try {
assert(value);
} catch (e, stackTrace) {
String message = "${widget != null ? "'" + widget.name + "' - " : ""} ERROR - Failed assertion: ";
List<String> stakTraceSplitted = stackTrace.toString().split("\n");
String lineCallingAssert = stakTraceSplitted[3].trim().substring(2).trim();
AnsiPen penError = new AnsiPen()..white()..rgb(r: 1.0, g: 0.0, b: 0.0);
print("\n" + penError(message + lineCallingAssert) + "\n");
countTestFailed++;
return false;
}
countTestPassed++;
try {
throw Exception();
} on Exception catch(e, stackTrace) {
String message = "${widget != null ? "'" + widget.name + "' - " : ""} Test ";
message += (name != null) ? "'$name' " : "";
message += "passed!";
List<String> stakTraceSplitted = stackTrace.toString().split("\n");
String lineCallingAssert = stakTraceSplitted[1].trim().substring(2).trim();
message += " $lineCallingAssert";
AnsiPen pen = new AnsiPen()..white()..rgb(r: 1.0, g: 0.8, b: 0.2);
print("\n" + pen(message) + "\n");
}
return true;
}

Binary file not shown.

View File

@ -0,0 +1,106 @@
/*
* Globals
*/
/* Links */
a,
a:focus,
a:hover {
color: #fff;
}
/* Custom default button */
.btn-secondary,
.btn-secondary:hover,
.btn-secondary:focus {
color: #333;
text-shadow: none; /* Prevent inheritance from `body` */
background-color: #fff;
border: .05rem solid #fff;
}
/*
* Base structure
*/
html,
body {
height: 100%;
background-color: #333;
}
body {
display: -ms-flexbox;
display: flex;
color: #fff;
text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5);
box-shadow: inset 0 0 5rem rgba(0, 0, 0, .5);
}
.cover-container {
max-width: 42em;
}
/*
* Header
*/
.masthead {
margin-bottom: 2rem;
}
.masthead-brand {
margin-bottom: 0;
}
.nav-masthead .nav-link {
padding: .25rem 0;
font-weight: 700;
color: rgba(255, 255, 255, .5);
background-color: transparent;
border-bottom: .25rem solid transparent;
}
.nav-masthead .nav-link:hover,
.nav-masthead .nav-link:focus {
border-bottom-color: rgba(255, 255, 255, .25);
}
.nav-masthead .nav-link + .nav-link {
margin-left: 1rem;
}
.nav-masthead .active {
color: #fff;
border-bottom-color: #fff;
}
@media (min-width: 48em) {
.masthead-brand {
float: left;
}
.nav-masthead {
float: right;
}
}
/*
* Cover
*/
.cover {
padding: 0 1.5rem;
}
.cover .btn-lg {
padding: .75rem 1.25rem;
font-weight: 700;
}
/*
* Footer
*/
.mastfoot {
color: rgba(255, 255, 255, .5);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewAjaxTest</title>
</head>
<body>
<h1>InAppWebViewAjaxTest</h1>
<script>
window.addEventListener('flutterInAppBrowserPlatformReady', function(event) {
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "http://192.168.1.20:8082/test-ajax-post");
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("firstname=Foo&lastname=Bar");
var xhttp2 = new XMLHttpRequest();
xhttp2.open("GET", "http://192.168.1.20:8082/test-download-file");
xhttp2.send();
});
</script>
</body>
</html>

View File

@ -0,0 +1,35 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewInitialFileTest</title>
<link rel="stylesheet" href="https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="shortcut icon" href="favicon.ico">
</head>
<body class="text-center">
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<h3 class="masthead-brand">InAppWebViewInitialFileTest</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="index.html">Home</a>
<a class="nav-link" href="page-1.html">Page 1</a>
<a class="nav-link" href="page-2.html">Page 2</a>
</nav>
</div>
</header>
<main role="main" class="inner cover">
<h1 class="cover-heading">InAppWebViewInitialFileTest</h1>
<img src="images/flutter-logo.svg" alt="flutter logo">
<p>
<img src="https://via.placeholder.com/100x50" alt="placeholder 100x50">
</p>
</main>
</div>
</body>
</html>

View File

@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewJavaScriptHandlerTest</title>
</head>
<body>
<h1>InAppWebViewJavaScriptHandlerTest</h1>
<script>
window.addEventListener("flutterInAppBrowserPlatformReady", function(event) {
window.flutter_inappbrowser.callHandler('handlerFoo').then(function(result) {
window.flutter_inappbrowser.callHandler('handlerFooWithArgs', 1, true, ['bar', 5], {foo: 'baz'}, result).then(function(result) {
});
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewOnLoadResourceTest</title>
<link rel="stylesheet" href="https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="shortcut icon" href="favicon.ico">
</head>
<body class="text-center">
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
<main role="main" class="inner cover">
<h1 class="cover-heading">InAppWebViewOnLoadResourceTest</h1>
<img src="images/flutter-logo.svg" alt="flutter logo">
<p>
<img src="https://via.placeholder.com/100x50" alt="placeholder 100x50">
</p>
</main>
</div>
</body>
</html>

View File

@ -0,0 +1,143 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Flutter InAppBrowser</title>
<link rel="stylesheet" href="http://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="shortcut icon" href="favicon.ico">
</head>
<body class="text-center">
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<h3 class="masthead-brand">Flutter InAppBrowser</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="index.html">Home</a>
<a class="nav-link" href="page-1.html">Page 1</a>
<a class="nav-link" href="page-2.html">Page 2</a>
</nav>
</div>
</header>
<main role="main" class="inner cover">
<h1 class="cover-heading">Inline WebView</h1>
<img src="my-special-custom-scheme://images/flutter-logo.svg" alt="flutter logo">
<p class="lead">Cover is a one-page template for building simple and beautiful home pages. Download, edit the text, and add your own fullscreen background photo to make it your own.</p>
<select name="" id="">
<option value="1">option 1</option>
<option value="2">option 2</option>
</select>
<input type="file">
<input type="file" accept="image/*" capture>
<button onclick="testHistoryPush1()">History Push 1</button>
<button onclick="testHistoryPush2()">History Push 2</button>
<button onclick="testLocationHref()">Location Href</button>
<p>
<img src="https://via.placeholder.com/100x50" alt="placeholder 100x50">
</p>
</main>
<!--<form method="POST" action="http://192.168.1.20:8082/test-post">
<input type="text" name="name" placeholder="name" value="Lorenzo">
<input type="submit" value="SEND">
</form>-->
<footer class="mastfoot mt-auto">
<div class="inner">
<p>Cover template for <a target="_blank" href="https://getbootstrap.com/">Bootstrap</a>, by <a href="https://twitter.com/mdo">@mdo</a>.</p>
<p>Phone link example <a href="tel:1-408-555-5555">1-408-555-5555</a></p>
<p>Email link example <a href="mailto:example@gmail.com">example@gmail.com</a></p>
</div>
</footer>
</div>
<script>
var state = { 'page_id': 1, 'user_id': 5 };
function testHistoryPush1() {
var randomNumber = 100 * Math.random();
var title = 'Hello World ' + randomNumber;
var url = 'hello-foo-' + randomNumber + '.html';
history.pushState(state, title, url);
}
function testHistoryPush2() {
var randomNumber = 100 * Math.random();
var title = 'Hello World ' + randomNumber;
var url = 'hello-bar-' + randomNumber + '.html';
history.replaceState(state, title, url);
}
function testLocationHref() {
var randomNumber = 100 * Math.random();
window.location = "#foo-" + randomNumber;
}
window.addEventListener("flutterInAppBrowserPlatformReady", function(event) {
window.flutter_inappbrowser.callHandler('handlerFoo').then(function(result) {
window.flutter_inappbrowser.callHandler('handlerFooWithArgs', 1, true, ['bar', 5], {foo: 'baz'}, result).then(function(result) {
});
});
});
$(document).ready(function() {
console.log("jQuery ready");
var xhttp = new XMLHttpRequest();
xhttp.addEventListener("load", function() {
console.log(this.response);
});
xhttp.open("POST", "http://192.168.1.20:8082/test-ajax-post");
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("name=Lorenzo");
var xhttp2 = new XMLHttpRequest();
xhttp2.open("GET", "http://192.168.1.20:8082/test-download-file");
xhttp2.send();
fetch(new Request("http://192.168.1.20:8082/test-download-file")).then(function(response) {
console.log(response);
}).catch(function(error) {
console.error("ERROR: " + error);
});
fetch("http://192.168.1.20:8082/test-ajax-post", {
method: 'POST',
body: JSON.stringify({
name: 'Lorenzo Fetch API'
}),
headers: {
'Content-Type': 'application/json'
}
}).then(function(response) {
console.log(response);
}).catch(function(error) {
console.error("ERROR: " + error);
});
/*
alert("Alert Popup");
console.log(confirm("Press a button!"));
console.log(prompt("Please enter your name", "Lorenzo"));
*/
/*
if ("geolocation" in navigator) {
console.log("Geolocation API enabled");
navigator.geolocation.getCurrentPosition(function(position) {
console.log(position.coords.latitude, position.coords.longitude);
});
} else {
console.log("No geolocation API");
}
*/
});
</script>
</body>
</html>

View File

@ -0,0 +1,40 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Flutter InAppBrowser</title>
<link rel="stylesheet" href="https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body class="text-center">
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<h3 class="masthead-brand">Flutter InAppBrowser</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link" href="index.html">Home</a>
<a class="nav-link active" href="page-1.html">Page 1</a>
<a class="nav-link" href="page-2.html">Page 2</a>
</nav>
</div>
</header>
<main role="main" class="inner cover">
<h1 class="cover-heading">Page 1</h1>
<p class="lead">Cover is a one-page template for building simple and beautiful home pages. Download, edit the text, and add your own fullscreen background photo to make it your own.</p>
<p class="lead">
<a href="#" class="btn btn-lg btn-secondary">Learn more</a>
</p>
</main>
<footer class="mastfoot mt-auto">
<div class="inner">
<p>Cover template for <a href="https://getbootstrap.com/">Bootstrap</a>, by <a href="https://twitter.com/mdo">@mdo</a>.</p>
</div>
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1,40 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Flutter InAppBrowser</title>
<link rel="stylesheet" href="https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body class="text-center">
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<h3 class="masthead-brand">Flutter InAppBrowser</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link" href="index.html">Home</a>
<a class="nav-link" href="page-1.html">Page 1</a>
<a class="nav-link active" href="page-2.html">Page 2</a>
</nav>
</div>
</header>
<main role="main" class="inner cover">
<h1 class="cover-heading">Page 2</h1>
<p class="lead">Cover is a one-page template for building simple and beautiful home pages. Download, edit the text, and add your own fullscreen background photo to make it your own.</p>
<p class="lead">
<a href="#" class="btn btn-lg btn-secondary">Learn more</a>
</p>
</main>
<footer class="mastfoot mt-auto">
<div class="inner">
<p>Cover template for <a href="https://getbootstrap.com/">Bootstrap</a>, by <a href="https://twitter.com/mdo">@mdo</a>.</p>
</div>
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1,12 @@
import 'package:flutter_driver/driver_extension.dart';
import 'app_test.dart';
import 'main_test.dart' as app;
void main() {
// This line enables the extension.
enableFlutterDriverExtension();
// Call the `main()` function of the app, or call `runApp` with
// any widget you are interested in testing.
app.main();
}

View File

@ -0,0 +1,102 @@
// Imports the Flutter Driver API.
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart';
void main() {
group('Flutter InAppBrowser', () {
FlutterDriver driver;
// Connect to the Flutter driver before running any tests.
setUpAll(() async {
driver = await FlutterDriver.connect();
});
// Close the connection to the driver after the tests have completed.
tearDownAll(() async {
if (driver != null) {
driver.close();
}
});
myTest({@required String name, @required Function callback, Timeout timeout}) {
timeout = (timeout == null) ? new Timeout(new Duration(minutes: 5)) : timeout;
test(name, () async {
await Future.delayed(const Duration(milliseconds: 2000));
callback();
}, timeout: timeout);
}
//
// IMPORTANT NOTE!!!
// These tests need to follow the same order of "var routes" in "buildRoutes()" function
// defined in main_test.dart
//
myTest(name: 'InAppWebViewInitialUrlTest', callback: () async {
final appBarTitle = find.byValueKey('AppBarTitle');
while((await driver.getText(appBarTitle)) == "InAppWebViewInitialUrlTest") {
await Future.delayed(const Duration(milliseconds: 1000));
}
String url = await driver.getText(appBarTitle);
expect(url, "https://flutter.dev/");
});
myTest(name: 'InAppWebViewInitialFileTest', callback: () async {
final appBarTitle = find.byValueKey('AppBarTitle');
while((await driver.getText(appBarTitle)) == "InAppWebViewInitialFileTest") {
await Future.delayed(const Duration(milliseconds: 1000));
}
String title = await driver.getText(appBarTitle);
expect(title, "true");
});
myTest(name: 'InAppWebViewOnLoadResourceTest', callback: () async {
List<String> resourceList = [
"https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css",
"https://code.jquery.com/jquery-3.3.1.min.js",
"https://via.placeholder.com/100x50"
];
final appBarTitle = find.byValueKey('AppBarTitle');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnLoadResourceTest") {
await Future.delayed(const Duration(milliseconds: 1000));
}
String title = await driver.getText(appBarTitle);
print(title);
for (String resource in resourceList) {
expect(true, title.contains(resource));
}
});
myTest(name: 'InAppWebViewJavaScriptHandlerTest', callback: () async {
final appBarTitle = find.byValueKey('AppBarTitle');
while((await driver.getText(appBarTitle)) == "InAppWebViewJavaScriptHandlerTest") {
await Future.delayed(const Duration(milliseconds: 1000));
}
String title = await driver.getText(appBarTitle);
expect(true, !title.contains("false"));
});
myTest(name: 'InAppWebViewAjaxTest', callback: () async {
final appBarTitle = find.byValueKey('AppBarTitle');
while((await driver.getText(appBarTitle)) == "InAppWebViewAjaxTest") {
await Future.delayed(const Duration(milliseconds: 1000));
}
String title = await driver.getText(appBarTitle);
expect(title, "Lorenzo Pichilli Lorenzo Pichilli");
});
});
}

View File

@ -0,0 +1,24 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
class WidgetTest extends StatefulWidget {
final WidgetTestState state = WidgetTestState();
WidgetTest({Key key}): super(key: key);
@override
WidgetTestState createState() {
return state;
}
}
class WidgetTestState extends State<WidgetTest> {
InAppWebViewController webView;
String appBarTitle;
@override
Widget build(BuildContext context) {
return null;
}
}

View File

@ -0,0 +1,86 @@
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
class InAppWebViewAjaxTest extends WidgetTest {
final InAppWebViewAjaxTestState state = InAppWebViewAjaxTestState();
@override
InAppWebViewAjaxTestState createState() => state;
}
class InAppWebViewAjaxTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewAjaxTest";
int totTests = 2;
int testsDone = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: myAppBar(state: this, title: appBarTitle),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialFile: "test_assets/in_app_webview_ajax_test.html",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true,
useShouldInterceptAjaxRequest: true,
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
},
shouldInterceptAjaxRequest: (InAppWebViewController controller, AjaxRequest ajaxRequest) async {
if (ajaxRequest.url.endsWith("/test-ajax-post")) {
ajaxRequest.responseType = 'json';
ajaxRequest.data = "firstname=Lorenzo&lastname=Pichilli";
}
return ajaxRequest;
},
onAjaxReadyStateChange: (InAppWebViewController controller, AjaxRequest ajaxRequest) async {
if (ajaxRequest.readyState == AjaxRequestReadyState.DONE && ajaxRequest.status == 200 && ajaxRequest.url.endsWith("/test-ajax-post")) {
Map<String, Object> res = ajaxRequest.response;
appBarTitle = (appBarTitle == "InAppWebViewAjaxTest") ? res['fullname'] : appBarTitle + " " + res['fullname'];
updateCountTest(context: context);
}
return AjaxRequestAction.PROCEED;
},
onAjaxProgress: (InAppWebViewController controller, AjaxRequest ajaxRequest) async {
if (ajaxRequest.event.type == AjaxRequestEventType.LOAD && ajaxRequest.url.endsWith("/test-ajax-post")) {
Map<String, Object> res = ajaxRequest.response;
appBarTitle = (appBarTitle == "InAppWebViewAjaxTest") ? res['fullname'] : appBarTitle + " " + res['fullname'];
updateCountTest(context: context);
}
return AjaxRequestAction.PROCEED;
},
),
),
),
])
)
);
}
void updateCountTest({@required BuildContext context}) {
testsDone++;
if (testsDone == totTests) {
setState(() { });
nextTest(context: context, state: this);
}
}
}

View File

@ -2,34 +2,37 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart'; import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
class InAppWebViewInitialFileTest extends WidgetTest { class InAppWebViewInitialFileTest extends WidgetTest {
InAppWebViewInitialFileTest(): super(name: "InAppWebViewInitialFileTest"); final InAppWebViewInitialFileTestState state = InAppWebViewInitialFileTestState();
@override @override
_InAppWebViewInitialFileTestState createState() => new _InAppWebViewInitialFileTestState(); InAppWebViewInitialFileTestState createState() => state;
} }
class _InAppWebViewInitialFileTestState extends State<InAppWebViewInitialFileTest> { class InAppWebViewInitialFileTestState extends WidgetTestState {
InAppWebViewController webView; String appBarTitle = "InAppWebViewInitialFileTest";
String initialUrl = "https://flutter.dev/";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: myAppBar(state: this, title: appBarTitle),
title: Text('InAppWebViewInitialFileTest'),
),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
child: InAppWebView( child: InAppWebView(
initialFile: "assets/index.html", initialFile: "test_assets/in_app_webview_initial_file_test.html",
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(), initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) { onWebViewCreated: (InAppWebViewController controller) {
webView = controller; webView = controller;
}, },
@ -37,8 +40,10 @@ class _InAppWebViewInitialFileTestState extends State<InAppWebViewInitialFileTes
}, },
onLoadStop: (InAppWebViewController controller, String url) { onLoadStop: (InAppWebViewController controller, String url) {
customAssert(widget: widget, name: "initialFile", value: true); setState(() {
nextTest(context: context); appBarTitle = "true";
});
nextTest(context: context, state: this);
}, },
), ),
), ),

View File

@ -2,26 +2,25 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
import 'main_test.dart';
import 'util_test.dart';
class InAppWebViewInitialUrlTest extends WidgetTest { class InAppWebViewInitialUrlTest extends WidgetTest {
InAppWebViewInitialUrlTest(): super(name: "InAppWebViewInitialUrlTest"); final InAppWebViewInitialUrlTestState state = InAppWebViewInitialUrlTestState();
@override @override
_InAppWebViewInitialUrlTestState createState() => new _InAppWebViewInitialUrlTestState(); InAppWebViewInitialUrlTestState createState() => state;
} }
class _InAppWebViewInitialUrlTestState extends State<InAppWebViewInitialUrlTest> { class InAppWebViewInitialUrlTestState extends WidgetTestState {
InAppWebViewController webView;
String initialUrl = "https://flutter.dev/"; String initialUrl = "https://flutter.dev/";
String appBarTitle = "InAppWebViewInitialUrlTest";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: myAppBar(state: this, title: appBarTitle),
title: Text('InAppWebViewInitialUrlTest'),
),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
@ -29,7 +28,12 @@ class _InAppWebViewInitialUrlTestState extends State<InAppWebViewInitialUrlTest>
child: InAppWebView( child: InAppWebView(
initialUrl: initialUrl, initialUrl: initialUrl,
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(), initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) { onWebViewCreated: (InAppWebViewController controller) {
webView = controller; webView = controller;
}, },
@ -37,8 +41,10 @@ class _InAppWebViewInitialUrlTestState extends State<InAppWebViewInitialUrlTest>
}, },
onLoadStop: (InAppWebViewController controller, String url) { onLoadStop: (InAppWebViewController controller, String url) {
customAssert(widget: widget, name: "initialUrl", value: url == initialUrl); setState(() {
nextTest(context: context); appBarTitle = url;
});
nextTest(context: context, state: this);
}, },
), ),
), ),

View File

@ -0,0 +1,84 @@
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
class Foo {
String bar;
String baz;
Foo({this.bar, this.baz});
Map<String, dynamic> toJson() {
return {
'bar': this.bar,
'baz': this.baz
};
}
}
class InAppWebViewJavaScriptHandlerTest extends WidgetTest {
final InAppWebViewJavaScriptHandlerTestState state = InAppWebViewJavaScriptHandlerTestState();
@override
InAppWebViewJavaScriptHandlerTestState createState() => state;
}
class InAppWebViewJavaScriptHandlerTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewJavaScriptHandlerTest";
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: myAppBar(state: this, title: appBarTitle),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialFile: "test_assets/in_app_webview_javascript_handler_test.html",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
controller.addJavaScriptHandler(handlerName:'handlerFoo', callback: (args) {
appBarTitle = (args.length == 0).toString();
return new Foo(bar: 'bar_value', baz: 'baz_value');
});
controller.addJavaScriptHandler(handlerName: 'handlerFooWithArgs', callback: (args) {
appBarTitle += " " + (args[0] is int).toString();
appBarTitle += " " + (args[1] is bool).toString();
appBarTitle += " " + (args[2] is List).toString();
appBarTitle += " " + (args[2] is List).toString();
appBarTitle += " " + (args[3] is Map).toString();
appBarTitle += " " + (args[4] is Map).toString();
setState(() { });
nextTest(context: context, state: this);
});
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
},
),
),
),
])
)
);
}
}

View File

@ -2,41 +2,41 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart'; import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
class InAppWebViewOnLoadResourceTest extends WidgetTest { class InAppWebViewOnLoadResourceTest extends WidgetTest {
InAppWebViewOnLoadResourceTest(): super(name: "InAppWebViewOnLoadResourceTest"); final InAppWebViewOnLoadResourceTestState state = InAppWebViewOnLoadResourceTestState();
@override @override
_InAppWebViewOnLoadResourceTestState createState() => new _InAppWebViewOnLoadResourceTestState(); InAppWebViewOnLoadResourceTestState createState() => state;
} }
class _InAppWebViewOnLoadResourceTestState extends State<InAppWebViewOnLoadResourceTest> { class InAppWebViewOnLoadResourceTestState extends WidgetTestState {
InAppWebViewController webView;
List<String> resourceList = [ List<String> resourceList = [
"http://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css", "https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css",
"https://code.jquery.com/jquery-3.3.1.min.js", "https://code.jquery.com/jquery-3.3.1.min.js",
"https://via.placeholder.com/100x50" "https://via.placeholder.com/100x50"
]; ];
int countResources = 0; int countResources = 0;
String appBarTitle = "InAppWebViewOnLoadResourceTest";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: myAppBar(state: this, title: appBarTitle),
title: Text('InAppWebViewOnLoadResourceTest'),
),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
child: InAppWebView( child: InAppWebView(
initialFile: "assets/index.html", initialFile: "test_assets/in_app_webview_on_load_resource_test.html",
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions( initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions( inAppWebViewOptions: InAppWebViewOptions(
clearCache: true, clearCache: true,
debuggingEnabled: true,
useOnLoadResource: true useOnLoadResource: true
) )
), ),
@ -50,10 +50,11 @@ class _InAppWebViewOnLoadResourceTestState extends State<InAppWebViewOnLoadResou
}, },
onLoadResource: (InAppWebViewController controller, LoadedResource response) { onLoadResource: (InAppWebViewController controller, LoadedResource response) {
customAssert(widget: widget, name: "onLoadResource", value: resourceList.contains(response.url)); appBarTitle = (appBarTitle == "InAppWebViewOnLoadResourceTest") ? response.url : appBarTitle + " " + response.url;
countResources++; countResources++;
if (countResources == resourceList.length) { if (countResources == resourceList.length) {
nextTest(context: context); setState(() { });
nextTest(context: context, state: this);
} }
} }
), ),

View File

@ -0,0 +1,72 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'custom_widget_test.dart';
import 'in_app_webview_ajax_test.dart';
import 'in_app_webview_initial_file_test.dart';
import 'in_app_webview_initial_url_test.dart';
import 'in_app_webview_javascript_handler_test.dart';
import 'in_app_webview_on_load_resource_test.dart';
List<String> testRoutes = [];
Map<String, WidgetBuilder> buildRoutes({@required BuildContext context}) {
var routes = {
'/': (context) => InAppWebViewInitialUrlTest(),
'/InAppWebViewInitialFileTest': (context) => InAppWebViewInitialFileTest(),
'/InAppWebViewOnLoadResourceTest': (context) => InAppWebViewOnLoadResourceTest(),
'/InAppWebViewJavaScriptHandlerTest': (context) => InAppWebViewJavaScriptHandlerTest(),
'/InAppWebViewAjaxTest': (context) => InAppWebViewAjaxTest(),
};
routes.forEach((k, v) => testRoutes.add(k));
return routes;
}
AppBar myAppBar({@required WidgetTestState state, @required String title}) {
return AppBar(
title: Text(
title,
key: Key("AppBarTitle")
),
actions: <Widget>[
IconButton(
icon: Icon(Icons.refresh),
onPressed: () {
if (state.webView != null)
state.webView.reload();
},
),
],
);
}
Future main() async {
runApp(new MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'flutter_inappbrowser tests',
initialRoute: '/',
routes: buildRoutes(context: context)
);
}
}

View File

@ -0,0 +1,19 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
int currentTest = 0;
void nextTest({@required BuildContext context, @required WidgetTestState state}) {
if (currentTest + 1 < testRoutes.length) {
currentTest++;
String nextRoute = testRoutes[currentTest];
Future.delayed(const Duration(milliseconds: 2000)).then((value) {
Navigator.pushReplacementNamed(context, nextRoute);
});
}
}

View File

@ -21,6 +21,15 @@
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/.pub" /> <excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/build" /> <excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_inappbrowser/example/build" />
<excludeFolder url="file://$MODULE_DIR$/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" />
<excludeFolder url="file://$MODULE_DIR$/flutter_inappbrowser_tests/build" />
<excludeFolder url="file://$MODULE_DIR$/test/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/test/.pub" />
<excludeFolder url="file://$MODULE_DIR$/test1/build" />
<excludeFolder url="file://$MODULE_DIR$/tests/flutter_in_app_browser_test/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/tests/flutter_in_app_browser_test/.pub" />
<excludeFolder url="file://$MODULE_DIR$/tests/flutter_in_app_browser_test/build" />
</content> </content>
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" /> <orderEntry type="library" name="Dart SDK" level="project" />

View File

@ -11,7 +11,10 @@ import WebKit
@available(iOS 11.0, *) @available(iOS 11.0, *)
class CustomeSchemeHandler : NSObject, WKURLSchemeHandler { class CustomeSchemeHandler : NSObject, WKURLSchemeHandler {
var schemeHandlers: [Int:WKURLSchemeTask] = [:]
func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask) { func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask) {
schemeHandlers[urlSchemeTask.hash] = urlSchemeTask
let inAppWebView = webView as! InAppWebView let inAppWebView = webView as! InAppWebView
if let url = urlSchemeTask.request.url, let scheme = url.scheme { if let url = urlSchemeTask.request.url, let scheme = url.scheme {
inAppWebView.onLoadResourceCustomScheme(scheme: scheme, url: url.absoluteString, result: {(result) -> Void in inAppWebView.onLoadResourceCustomScheme(scheme: scheme, url: url.absoluteString, result: {(result) -> Void in
@ -25,9 +28,12 @@ class CustomeSchemeHandler : NSObject, WKURLSchemeHandler {
json = r as! [String: Any] json = r as! [String: Any]
let urlResponse = URLResponse(url: url, mimeType: json["content-type"] as! String, expectedContentLength: -1, textEncodingName: json["content-encoding"] as! String) let urlResponse = URLResponse(url: url, mimeType: json["content-type"] as! String, expectedContentLength: -1, textEncodingName: json["content-encoding"] as! String)
let data = json["data"] as! FlutterStandardTypedData let data = json["data"] as! FlutterStandardTypedData
urlSchemeTask.didReceive(urlResponse) if (self.schemeHandlers[urlSchemeTask.hash] != nil) {
urlSchemeTask.didReceive(data.data) urlSchemeTask.didReceive(urlResponse)
urlSchemeTask.didFinish() urlSchemeTask.didReceive(data.data)
urlSchemeTask.didFinish()
self.schemeHandlers.removeValue(forKey: urlSchemeTask.hash)
}
} }
} }
}) })
@ -35,6 +41,6 @@ class CustomeSchemeHandler : NSObject, WKURLSchemeHandler {
} }
func webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask) { func webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask) {
schemeHandlers.removeValue(forKey: urlSchemeTask.hash)
} }
} }

View File

@ -82,6 +82,8 @@ window.\(JAVASCRIPT_BRIDGE_NAME).callHandler = function() {
} }
""" """
let platformReadyJS = "window.dispatchEvent(new Event('flutterInAppBrowserPlatformReady'));";
let findTextHighlightJS = """ let findTextHighlightJS = """
var wkwebview_SearchResultCount = 0; var wkwebview_SearchResultCount = 0;
var wkwebview_CurrentHighlight = 0; var wkwebview_CurrentHighlight = 0;
@ -298,7 +300,6 @@ let interceptAjaxRequestsJS = """
}; };
ajax.prototype.setRequestHeader = function(header, value) { ajax.prototype.setRequestHeader = function(header, value) {
this._flutter_inappbrowser_request_headers[header] = value; this._flutter_inappbrowser_request_headers[header] = value;
setRequestHeader.call(this, header, value);
}; };
function handleEvent(e) { function handleEvent(e) {
var self = this; var self = this;
@ -439,7 +440,11 @@ let interceptAjaxRequestsJS = """
}; };
for (var header in result.headers) { for (var header in result.headers) {
var value = result.headers[header]; var value = result.headers[header];
self.setRequestHeader(header, value); self._flutter_inappbrowser_request_headers[header] = value;
};
for (var header in self._flutter_inappbrowser_request_headers) {
var value = self._flutter_inappbrowser_request_headers[header];
setRequestHeader.call(self, header, value);
}; };
if ((self._flutter_inappbrowser_method != result.method && result.method != null) || (self._flutter_inappbrowser_url != result.url && result.url != null)) { if ((self._flutter_inappbrowser_method != result.method && result.method != null) || (self._flutter_inappbrowser_url != result.url && result.url != null)) {
self.abort(); self.abort();
@ -1342,6 +1347,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
currentURL = url currentURL = url
InAppWebView.credentialsProposed = [] InAppWebView.credentialsProposed = []
evaluateJavaScript(platformReadyJS, completionHandler: nil)
onLoadStop(url: (currentURL?.absoluteString)!) onLoadStop(url: (currentURL?.absoluteString)!)
if IABController != nil { if IABController != nil {

View File

@ -53,6 +53,11 @@ class ContentBlockerTriggerResourceType {
static const SVG_DOCUMENT = const ContentBlockerTriggerResourceType._internal('svg-document'); static const SVG_DOCUMENT = const ContentBlockerTriggerResourceType._internal('svg-document');
///Any untyped load ///Any untyped load
static const RAW = const ContentBlockerTriggerResourceType._internal('raw'); static const RAW = const ContentBlockerTriggerResourceType._internal('raw');
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///ContentBlockerTriggerLoadType class represents the possible load type for a [ContentBlockerTrigger]. ///ContentBlockerTriggerLoadType class represents the possible load type for a [ContentBlockerTrigger].
@ -68,6 +73,11 @@ class ContentBlockerTriggerLoadType {
static const FIRST_PARTY = const ContentBlockerTriggerLoadType._internal('first-party'); static const FIRST_PARTY = const ContentBlockerTriggerLoadType._internal('first-party');
///THIRD_PARTY is triggered if the resource is not from the same domain as the main page resource. ///THIRD_PARTY is triggered if the resource is not from the same domain as the main page resource.
static const THIRD_PARTY = const ContentBlockerTriggerLoadType._internal('third-party'); static const THIRD_PARTY = const ContentBlockerTriggerLoadType._internal('third-party');
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///Trigger of the content blocker. The trigger tells to the WebView when to perform the corresponding action. ///Trigger of the content blocker. The trigger tells to the WebView when to perform the corresponding action.
@ -187,6 +197,11 @@ class ContentBlockerActionType {
static const CSS_DISPLAY_NONE = const ContentBlockerActionType._internal('css-display-none'); static const CSS_DISPLAY_NONE = const ContentBlockerActionType._internal('css-display-none');
///Changes a URL from http to https. URLs with a specified (nondefault) port and links using other protocols are unaffected. ///Changes a URL from http to https. URLs with a specified (nondefault) port and links using other protocols are unaffected.
static const MAKE_HTTPS = const ContentBlockerActionType._internal('make-https'); static const MAKE_HTTPS = const ContentBlockerActionType._internal('make-https');
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///Action associated to the trigger. The action tells to the WebView what to do when the trigger is matched. ///Action associated to the trigger. The action tells to the WebView what to do when the trigger is matched.

View File

@ -97,7 +97,7 @@ class InAppBrowser {
/// uses-material-design: true /// uses-material-design: true
/// ///
/// assets: /// assets:
/// - assets/t-rex.html /// - assets/index.html
/// - assets/css/ /// - assets/css/
/// - assets/images/ /// - assets/images/
/// ///
@ -106,7 +106,7 @@ class InAppBrowser {
///Example of a `main.dart` file: ///Example of a `main.dart` file:
///```dart ///```dart
///... ///...
///inAppBrowser.openFile("assets/t-rex.html"); ///inAppBrowser.openFile("assets/index.html");
///... ///...
///``` ///```
/// ///

View File

@ -153,6 +153,10 @@ class InAppWebView extends StatefulWidget {
///[ajaxRequest] represents the `XMLHttpRequest`. ///[ajaxRequest] represents the `XMLHttpRequest`.
/// ///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldInterceptAjaxRequest] option to `true`. ///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldInterceptAjaxRequest] option to `true`.
///Also, unlike iOS that has [WKUserScript](https://developer.apple.com/documentation/webkit/wkuserscript) that
///can inject javascript code right after the document element is created but before any other content is loaded, in Android the javascript code
///used to intercept ajax requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppBrowserPlatformReady")` event, the fetch requests will be intercept for sure.
final Future<AjaxRequest> Function(InAppWebViewController controller, AjaxRequest ajaxRequest) shouldInterceptAjaxRequest; final Future<AjaxRequest> Function(InAppWebViewController controller, AjaxRequest ajaxRequest) shouldInterceptAjaxRequest;
///Event fired whenever the `readyState` attribute of an `XMLHttpRequest` changes. ///Event fired whenever the `readyState` attribute of an `XMLHttpRequest` changes.
@ -161,6 +165,10 @@ class InAppWebView extends StatefulWidget {
///[ajaxRequest] represents the [XMLHttpRequest]. ///[ajaxRequest] represents the [XMLHttpRequest].
/// ///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldInterceptAjaxRequest] option to `true`. ///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldInterceptAjaxRequest] option to `true`.
///Also, unlike iOS that has [WKUserScript](https://developer.apple.com/documentation/webkit/wkuserscript) that
///can inject javascript code right after the document element is created but before any other content is loaded, in Android the javascript code
///used to intercept ajax requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppBrowserPlatformReady")` event, the fetch requests will be intercept for sure.
final Future<AjaxRequestAction> Function(InAppWebViewController controller, AjaxRequest ajaxRequest) onAjaxReadyStateChange; final Future<AjaxRequestAction> Function(InAppWebViewController controller, AjaxRequest ajaxRequest) onAjaxReadyStateChange;
///Event fired as an `XMLHttpRequest` progress. ///Event fired as an `XMLHttpRequest` progress.
@ -169,6 +177,10 @@ class InAppWebView extends StatefulWidget {
///[ajaxRequest] represents the [XMLHttpRequest]. ///[ajaxRequest] represents the [XMLHttpRequest].
/// ///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldInterceptAjaxRequest] option to `true`. ///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldInterceptAjaxRequest] option to `true`.
///Also, unlike iOS that has [WKUserScript](https://developer.apple.com/documentation/webkit/wkuserscript) that
///can inject javascript code right after the document element is created but before any other content is loaded, in Android the javascript code
///used to intercept ajax requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppBrowserPlatformReady")` event, the fetch requests will be intercept for sure.
final Future<AjaxRequestAction> Function(InAppWebViewController controller, AjaxRequest ajaxRequest) onAjaxProgress; final Future<AjaxRequestAction> Function(InAppWebViewController controller, AjaxRequest ajaxRequest) onAjaxProgress;
///Event fired when an request is sent to a server through [Fetch API](https://developer.mozilla.org/it/docs/Web/API/Fetch_API). ///Event fired when an request is sent to a server through [Fetch API](https://developer.mozilla.org/it/docs/Web/API/Fetch_API).
@ -177,6 +189,10 @@ class InAppWebView extends StatefulWidget {
///[fetchRequest] represents a resource request. ///[fetchRequest] represents a resource request.
/// ///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldInterceptFetchRequest] option to `true`. ///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewOptions.useShouldInterceptFetchRequest] option to `true`.
///Also, unlike iOS that has [WKUserScript](https://developer.apple.com/documentation/webkit/wkuserscript) that
///can inject javascript code right after the document element is created but before any other content is loaded, in Android the javascript code
///used to intercept fetch requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppBrowserPlatformReady")` event, the fetch requests will be intercept for sure.
final Future<FetchRequest> Function(InAppWebViewController controller, FetchRequest fetchRequest) shouldInterceptFetchRequest; final Future<FetchRequest> Function(InAppWebViewController controller, FetchRequest fetchRequest) shouldInterceptFetchRequest;
///Event fired when the navigation state of the [InAppWebView] changes throught the usage of ///Event fired when the navigation state of the [InAppWebView] changes throught the usage of
@ -922,7 +938,7 @@ class InAppWebViewController {
/// uses-material-design: true /// uses-material-design: true
/// ///
/// assets: /// assets:
/// - assets/t-rex.html /// - assets/index.html
/// - assets/css/ /// - assets/css/
/// - assets/images/ /// - assets/images/
/// ///
@ -931,7 +947,7 @@ class InAppWebViewController {
///Example of a `main.dart` file: ///Example of a `main.dart` file:
///```dart ///```dart
///... ///...
///inAppBrowser.loadFile("assets/t-rex.html"); ///inAppBrowser.loadFile("assets/index.html");
///... ///...
///``` ///```
Future<void> loadFile({@required String assetFilePath, Map<String, String> headers = const {}}) async { Future<void> loadFile({@required String assetFilePath, Map<String, String> headers = const {}}) async {
@ -1111,6 +1127,14 @@ class InAppWebViewController {
///The JavaScript function that can be used to call the handler is `window.flutter_inappbrowser.callHandler(handlerName <String>, ...args)`, where `args` are [rest parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). ///The JavaScript function that can be used to call the handler is `window.flutter_inappbrowser.callHandler(handlerName <String>, ...args)`, where `args` are [rest parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
///The `args` will be stringified automatically using `JSON.stringify(args)` method and then they will be decoded on the Dart side. ///The `args` will be stringified automatically using `JSON.stringify(args)` method and then they will be decoded on the Dart side.
/// ///
///In order to call `window.flutter_inappbrowser.callHandler(handlerName <String>, ...args)` properly, you need to wait and listen the JavaScript event `flutterInAppBrowserPlatformReady`.
///This event will be dispatch as soon as the platform (Android or iOS) is ready to handle the `callHandler` method.
///```javascript
/// window.addEventListener("flutterInAppBrowserPlatformReady", function(event) {
/// console.log("ready");
/// });
///```
///
///`window.flutter_inappbrowser.callHandler` returns a JavaScript [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) ///`window.flutter_inappbrowser.callHandler` returns a JavaScript [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
///that can be used to get the json result returned by [JavaScriptHandlerCallback]. ///that can be used to get the json result returned by [JavaScriptHandlerCallback].
///In this case, simply return data that you want to send and it will be automatically json encoded using [jsonEncode] from the `dart:convert` library. ///In this case, simply return data that you want to send and it will be automatically json encoded using [jsonEncode] from the `dart:convert` library.
@ -1118,6 +1142,7 @@ class InAppWebViewController {
///So, on the JavaScript side, to get data coming from the Dart side, you will use: ///So, on the JavaScript side, to get data coming from the Dart side, you will use:
///```html ///```html
///<script> ///<script>
/// window.addEventListener("flutterInAppBrowserPlatformReady", function(event) {
/// window.flutter_inappbrowser.callHandler('handlerFoo').then(function(result) { /// window.flutter_inappbrowser.callHandler('handlerFoo').then(function(result) {
/// console.log(result, typeof result); /// console.log(result, typeof result);
/// console.log(JSON.stringify(result)); /// console.log(JSON.stringify(result));
@ -1127,8 +1152,19 @@ class InAppWebViewController {
/// console.log(result, typeof result); /// console.log(result, typeof result);
/// console.log(JSON.stringify(result)); /// console.log(JSON.stringify(result));
/// }); /// });
/// });
///</script> ///</script>
///``` ///```
///
///Instead, on the `onLoadStop` WebView event, you can use `callHandler` directly:
///```dart
/// // Inject JavaScript that will receive data back from Flutter
/// inAppWebViewController.evaluateJavascript(source: """
/// window.flutter_inappbrowser.callHandler('test', 'Text from Javascript').then(function(result) {
/// console.log(result);
/// });
/// """);
///```
void addJavaScriptHandler({@required String handlerName, @required JavaScriptHandlerCallback callback}) { void addJavaScriptHandler({@required String handlerName, @required JavaScriptHandlerCallback callback}) {
assert(!javaScriptHandlerForbiddenNames.contains(handlerName)); assert(!javaScriptHandlerForbiddenNames.contains(handlerName));
this.javaScriptHandlersMap[handlerName] = (callback); this.javaScriptHandlersMap[handlerName] = (callback);

View File

@ -39,6 +39,12 @@ class ConsoleMessageLevel {
static const WARNING = const ConsoleMessageLevel._internal(2); static const WARNING = const ConsoleMessageLevel._internal(2);
static const ERROR = const ConsoleMessageLevel._internal(3); static const ERROR = const ConsoleMessageLevel._internal(3);
static const DEBUG = const ConsoleMessageLevel._internal(4); static const DEBUG = const ConsoleMessageLevel._internal(4);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///Public class representing a resource response of the [InAppBrowser] WebView. ///Public class representing a resource response of the [InAppBrowser] WebView.
@ -204,6 +210,11 @@ class JsAlertResponseAction {
toValue() => _value; toValue() => _value;
static const CONFIRM = const JsAlertResponseAction._internal(0); static const CONFIRM = const JsAlertResponseAction._internal(0);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///JsAlertResponse class represents the response used by the [onJsAlert] event to control a JavaScript alert dialog. ///JsAlertResponse class represents the response used by the [onJsAlert] event to control a JavaScript alert dialog.
@ -237,6 +248,11 @@ class JsConfirmResponseAction {
static const CONFIRM = const JsConfirmResponseAction._internal(0); static const CONFIRM = const JsConfirmResponseAction._internal(0);
static const CANCEL = const JsConfirmResponseAction._internal(1); static const CANCEL = const JsConfirmResponseAction._internal(1);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///JsConfirmResponse class represents the response used by the [onJsConfirm] event to control a JavaScript confirm dialog. ///JsConfirmResponse class represents the response used by the [onJsConfirm] event to control a JavaScript confirm dialog.
@ -273,6 +289,11 @@ class JsPromptResponseAction {
static const CONFIRM = const JsPromptResponseAction._internal(0); static const CONFIRM = const JsPromptResponseAction._internal(0);
static const CANCEL = const JsPromptResponseAction._internal(1); static const CANCEL = const JsPromptResponseAction._internal(1);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///JsPromptResponse class represents the response used by the [onJsPrompt] event to control a JavaScript prompt dialog. ///JsPromptResponse class represents the response used by the [onJsPrompt] event to control a JavaScript prompt dialog.
@ -323,6 +344,11 @@ class SafeBrowsingThreat {
static const SAFE_BROWSING_THREAT_PHISHING = const SafeBrowsingThreat._internal(2); static const SAFE_BROWSING_THREAT_PHISHING = const SafeBrowsingThreat._internal(2);
static const SAFE_BROWSING_THREAT_UNWANTED_SOFTWARE = const SafeBrowsingThreat._internal(3); static const SAFE_BROWSING_THREAT_UNWANTED_SOFTWARE = const SafeBrowsingThreat._internal(3);
static const SAFE_BROWSING_THREAT_BILLING = const SafeBrowsingThreat._internal(4); static const SAFE_BROWSING_THREAT_BILLING = const SafeBrowsingThreat._internal(4);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///SafeBrowsingResponseAction class used by [SafeBrowsingResponse] class. ///SafeBrowsingResponseAction class used by [SafeBrowsingResponse] class.
@ -337,6 +363,11 @@ class SafeBrowsingResponseAction {
static const PROCEED = const SafeBrowsingResponseAction._internal(1); static const PROCEED = const SafeBrowsingResponseAction._internal(1);
///Display the default interstitial. ///Display the default interstitial.
static const SHOW_INTERSTITIAL = const SafeBrowsingResponseAction._internal(2); static const SHOW_INTERSTITIAL = const SafeBrowsingResponseAction._internal(2);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///SafeBrowsingResponse class represents the response used by the [onSafeBrowsingHit] event. ///SafeBrowsingResponse class represents the response used by the [onSafeBrowsingHit] event.
@ -369,6 +400,11 @@ class HttpAuthResponseAction {
static const PROCEED = const HttpAuthResponseAction._internal(1); static const PROCEED = const HttpAuthResponseAction._internal(1);
///Uses the credentials stored for the current host. ///Uses the credentials stored for the current host.
static const USE_SAVED_HTTP_AUTH_CREDENTIALS = const HttpAuthResponseAction._internal(2); static const USE_SAVED_HTTP_AUTH_CREDENTIALS = const HttpAuthResponseAction._internal(2);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///HttpAuthResponse class represents the response used by the [onReceivedHttpAuthRequest] event. ///HttpAuthResponse class represents the response used by the [onReceivedHttpAuthRequest] event.
@ -442,6 +478,11 @@ class ServerTrustAuthResponseAction {
static const CANCEL = const ServerTrustAuthResponseAction._internal(0); static const CANCEL = const ServerTrustAuthResponseAction._internal(0);
///Instructs the WebView to proceed with the authentication challenge. ///Instructs the WebView to proceed with the authentication challenge.
static const PROCEED = const ServerTrustAuthResponseAction._internal(1); static const PROCEED = const ServerTrustAuthResponseAction._internal(1);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///ServerTrustAuthResponse class represents the response used by the [onReceivedServerTrustAuthRequest] event. ///ServerTrustAuthResponse class represents the response used by the [onReceivedServerTrustAuthRequest] event.
@ -489,6 +530,11 @@ class ClientCertResponseAction {
static const PROCEED = const ClientCertResponseAction._internal(1); static const PROCEED = const ClientCertResponseAction._internal(1);
///Ignore the request for now. ///Ignore the request for now.
static const IGNORE = const ClientCertResponseAction._internal(2); static const IGNORE = const ClientCertResponseAction._internal(2);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///ClientCertResponse class represents the response used by the [onReceivedClientCertRequest] event. ///ClientCertResponse class represents the response used by the [onReceivedClientCertRequest] event.
@ -564,6 +610,11 @@ class AndroidInAppWebViewCacheMode {
static const LOAD_NO_CACHE = const AndroidInAppWebViewCacheMode._internal(2); static const LOAD_NO_CACHE = const AndroidInAppWebViewCacheMode._internal(2);
///Don't use the network, load from the cache. ///Don't use the network, load from the cache.
static const LOAD_CACHE_ONLY = const AndroidInAppWebViewCacheMode._internal(3); static const LOAD_CACHE_ONLY = const AndroidInAppWebViewCacheMode._internal(3);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///AndroidInAppWebViewModeMenuItem class represents an Android-specific class used to disable the action mode menu items. ///AndroidInAppWebViewModeMenuItem class represents an Android-specific class used to disable the action mode menu items.
@ -587,6 +638,11 @@ class AndroidInAppWebViewModeMenuItem {
static const MENU_ITEM_WEB_SEARCH = const AndroidInAppWebViewModeMenuItem._internal(2); static const MENU_ITEM_WEB_SEARCH = const AndroidInAppWebViewModeMenuItem._internal(2);
///Disable all the action mode menu items for text processing. ///Disable all the action mode menu items for text processing.
static const MENU_ITEM_PROCESS_TEXT = const AndroidInAppWebViewModeMenuItem._internal(4); static const MENU_ITEM_PROCESS_TEXT = const AndroidInAppWebViewModeMenuItem._internal(4);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///AndroidInAppWebViewForceDark class represents an Android-specific class used to indicate the force dark mode. ///AndroidInAppWebViewForceDark class represents an Android-specific class used to indicate the force dark mode.
@ -609,6 +665,11 @@ class AndroidInAppWebViewForceDark {
static const FORCE_DARK_AUTO = const AndroidInAppWebViewForceDark._internal(1); static const FORCE_DARK_AUTO = const AndroidInAppWebViewForceDark._internal(1);
///Unconditionally enable force dark. In this mode WebView content will always be rendered so as to emulate a dark theme. ///Unconditionally enable force dark. In this mode WebView content will always be rendered so as to emulate a dark theme.
static const FORCE_DARK_ON = const AndroidInAppWebViewForceDark._internal(2); static const FORCE_DARK_ON = const AndroidInAppWebViewForceDark._internal(2);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///AndroidInAppWebViewLayoutAlgorithm class represents an Android-specific class used to set the underlying layout algorithm. ///AndroidInAppWebViewLayoutAlgorithm class represents an Android-specific class used to set the underlying layout algorithm.
@ -627,6 +688,11 @@ class AndroidInAppWebViewLayoutAlgorithm {
/// ///
///**NOTE**: available on Android 19+. ///**NOTE**: available on Android 19+.
static const TEXT_AUTOSIZING = const AndroidInAppWebViewLayoutAlgorithm._internal("TEXT_AUTOSIZING"); static const TEXT_AUTOSIZING = const AndroidInAppWebViewLayoutAlgorithm._internal("TEXT_AUTOSIZING");
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///AndroidInAppWebViewMixedContentMode class represents an Android-specific class used to configure the WebView's behavior when a secure origin attempts to load a resource from an insecure origin. ///AndroidInAppWebViewMixedContentMode class represents an Android-specific class used to configure the WebView's behavior when a secure origin attempts to load a resource from an insecure origin.
@ -654,6 +720,11 @@ class AndroidInAppWebViewMixedContentMode {
///This mode is intended to be used by apps that are not in control of the content that they render but desire to operate in a reasonably secure environment. ///This mode is intended to be used by apps that are not in control of the content that they render but desire to operate in a reasonably secure environment.
///For highest security, apps are recommended to use [AndroidInAppWebViewMixedContentMode.MIXED_CONTENT_NEVER_ALLOW]. ///For highest security, apps are recommended to use [AndroidInAppWebViewMixedContentMode.MIXED_CONTENT_NEVER_ALLOW].
static const MIXED_CONTENT_COMPATIBILITY_MODE = const AndroidInAppWebViewMixedContentMode._internal(2); static const MIXED_CONTENT_COMPATIBILITY_MODE = const AndroidInAppWebViewMixedContentMode._internal(2);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///IosInAppWebViewSelectionGranularity class represents an iOS-specific class used to set the level of granularity with which the user can interactively select content in the web view. ///IosInAppWebViewSelectionGranularity class represents an iOS-specific class used to set the level of granularity with which the user can interactively select content in the web view.
@ -671,6 +742,11 @@ class IosInAppWebViewSelectionGranularity {
static const DYNAMIC = const IosInAppWebViewSelectionGranularity._internal(0); static const DYNAMIC = const IosInAppWebViewSelectionGranularity._internal(0);
///Selection endpoints can be placed at any character boundary. ///Selection endpoints can be placed at any character boundary.
static const CHARACTER = const IosInAppWebViewSelectionGranularity._internal(1); static const CHARACTER = const IosInAppWebViewSelectionGranularity._internal(1);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///IosInAppWebViewDataDetectorTypes class represents an iOS-specific class used to specify a dataDetectoryTypes value that adds interactivity to web content that matches the value. ///IosInAppWebViewDataDetectorTypes class represents an iOS-specific class used to specify a dataDetectoryTypes value that adds interactivity to web content that matches the value.
@ -705,6 +781,11 @@ class IosInAppWebViewDataDetectorTypes {
static const SPOTLIGHT_SUGGESTION = const IosInAppWebViewDataDetectorTypes._internal("SPOTLIGHT_SUGGESTION"); static const SPOTLIGHT_SUGGESTION = const IosInAppWebViewDataDetectorTypes._internal("SPOTLIGHT_SUGGESTION");
///All of the above data types are turned into links when detected. Choosing this value will automatically include any new detection type that is added. ///All of the above data types are turned into links when detected. Choosing this value will automatically include any new detection type that is added.
static const ALL = const IosInAppWebViewDataDetectorTypes._internal("ALL"); static const ALL = const IosInAppWebViewDataDetectorTypes._internal("ALL");
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///InAppWebViewUserPreferredContentMode class represents the content mode to prefer when loading and rendering a webpage. ///InAppWebViewUserPreferredContentMode class represents the content mode to prefer when loading and rendering a webpage.
@ -724,6 +805,11 @@ class InAppWebViewUserPreferredContentMode {
static const MOBILE = const InAppWebViewUserPreferredContentMode._internal(1); static const MOBILE = const InAppWebViewUserPreferredContentMode._internal(1);
///Represents content targeting desktop browsers. ///Represents content targeting desktop browsers.
static const DESKTOP = const InAppWebViewUserPreferredContentMode._internal(2); static const DESKTOP = const InAppWebViewUserPreferredContentMode._internal(2);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///IosWebViewOptionsPresentationStyle class represents an iOS-specific class used to specify the modal presentation style when presenting a view controller. ///IosWebViewOptionsPresentationStyle class represents an iOS-specific class used to specify the modal presentation style when presenting a view controller.
@ -759,6 +845,11 @@ class IosWebViewOptionsPresentationStyle {
/// ///
///**NOTE**: available on iOS 13.0+. ///**NOTE**: available on iOS 13.0+.
static const AUTOMATIC = const IosWebViewOptionsPresentationStyle._internal(9); static const AUTOMATIC = const IosWebViewOptionsPresentationStyle._internal(9);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///IosWebViewOptionsTransitionStyle class represents an iOS-specific class used to specify the transition style when presenting a view controller. ///IosWebViewOptionsTransitionStyle class represents an iOS-specific class used to specify the transition style when presenting a view controller.
@ -786,6 +877,11 @@ class IosWebViewOptionsTransitionStyle {
///On dismissal, the curled up page unfurls itself back on top of the presented view. ///On dismissal, the curled up page unfurls itself back on top of the presented view.
///A view controller presented using this transition is itself prevented from presenting any additional view controllers. ///A view controller presented using this transition is itself prevented from presenting any additional view controllers.
static const PARTIAL_CURL = const IosWebViewOptionsTransitionStyle._internal(3); static const PARTIAL_CURL = const IosWebViewOptionsTransitionStyle._internal(3);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///IosWebViewOptionsTransitionStyle class represents an iOS-specific class used to set the custom style for the dismiss button. ///IosWebViewOptionsTransitionStyle class represents an iOS-specific class used to set the custom style for the dismiss button.
@ -807,6 +903,11 @@ class IosSafariOptionsDismissButtonStyle {
static const CLOSE = const IosSafariOptionsDismissButtonStyle._internal(1); static const CLOSE = const IosSafariOptionsDismissButtonStyle._internal(1);
///Makes the button title the localized string "Cancel". ///Makes the button title the localized string "Cancel".
static const CANCEL = const IosSafariOptionsDismissButtonStyle._internal(2); static const CANCEL = const IosSafariOptionsDismissButtonStyle._internal(2);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///InAppWebViewWidgetOptions class represents the options that can be used for an [InAppWebView]. ///InAppWebViewWidgetOptions class represents the options that can be used for an [InAppWebView].
@ -856,6 +957,11 @@ class AjaxRequestAction {
///Proceeds with the current [AjaxRequest]. ///Proceeds with the current [AjaxRequest].
static const PROCEED = const AjaxRequestAction._internal(1); static const PROCEED = const AjaxRequestAction._internal(1);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
return { return {
"action": _value, "action": _value,
@ -892,6 +998,11 @@ class AjaxRequestEventType {
static const ABORT = const AjaxRequestEventType._internal("abort"); static const ABORT = const AjaxRequestEventType._internal("abort");
///The TIMEOUT event is fired when progression is terminated due to preset time expiring. ///The TIMEOUT event is fired when progression is terminated due to preset time expiring.
static const TIMEOUT = const AjaxRequestEventType._internal("timeout"); static const TIMEOUT = const AjaxRequestEventType._internal("timeout");
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///AjaxRequestEvent class used by [AjaxRequest] class. It represents events measuring progress of an [AjaxRequest]. ///AjaxRequestEvent class used by [AjaxRequest] class. It represents events measuring progress of an [AjaxRequest].
@ -934,6 +1045,11 @@ class AjaxRequestReadyState {
static const LOADING = const AjaxRequestReadyState._internal(3); static const LOADING = const AjaxRequestReadyState._internal(3);
///The operation is complete. ///The operation is complete.
static const DONE = const AjaxRequestReadyState._internal(4); static const DONE = const AjaxRequestReadyState._internal(4);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///AjaxRequest class represents a JavaScript [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) object. ///AjaxRequest class represents a JavaScript [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) object.
@ -1029,6 +1145,11 @@ class FetchRequestAction {
static const ABORT = const FetchRequestAction._internal(0); static const ABORT = const FetchRequestAction._internal(0);
///Proceeds with the fetch request. ///Proceeds with the fetch request.
static const PROCEED = const FetchRequestAction._internal(1); static const PROCEED = const FetchRequestAction._internal(1);
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
} }
///FetchRequestCredential class is an interface for [FetchRequestCredentialDefault], [FetchRequestFederatedCredential] and [FetchRequestPasswordCredential] classes. ///FetchRequestCredential class is an interface for [FetchRequestCredentialDefault], [FetchRequestFederatedCredential] and [FetchRequestPasswordCredential] classes.

View File

@ -113,6 +113,7 @@ app.get("/", (req, res) => {
app.post("/test-post", (req, res) => { app.post("/test-post", (req, res) => {
console.log(JSON.stringify(req.headers)) console.log(JSON.stringify(req.headers))
console.log(JSON.stringify(req.body))
res.send(` res.send(`
<html> <html>
<head> <head>
@ -127,10 +128,12 @@ app.post("/test-post", (req, res) => {
app.post("/test-ajax-post", (req, res) => { app.post("/test-ajax-post", (req, res) => {
console.log(JSON.stringify(req.headers)) console.log(JSON.stringify(req.headers))
console.log(JSON.stringify(req.body))
res.set("Content-Type", "application/json") res.set("Content-Type", "application/json")
res.send(JSON.stringify({ res.send(JSON.stringify({
"name": req.body.name, "firstname": req.body.firstname,
"key2": "value2" "lastname": req.body.lastname,
"fullname": req.body.firstname + " " + req.body.lastname,
})) }))
res.end() res.end()
}) })