Skip to content

Commit

Permalink
fix #696
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo committed Mar 1, 2021
1 parent b41eb69 commit 03a09bf
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 747 deletions.
738 changes: 0 additions & 738 deletions .idea/libraries/Dart_Packages.xml

This file was deleted.

4 changes: 3 additions & 1 deletion .idea/libraries/Flutter_Plugins.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.0.5+1

- Fixed "No bounce in inappwebview iOS" [#696](https://github.com/pichillilorenzo/flutter_inappwebview/issues/696)

## 5.0.5

- Updated Android `WebChromeClient.getDefaultVideoPoster`
Expand Down
2 changes: 1 addition & 1 deletion example/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.0-nullsafety/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.6/","dependencies":[]}],"android":[{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.0-nullsafety/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.6/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.5-nullsafety/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.1.0-nullsafety.2/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.2.0-nullsafety/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.1.0-nullsafety.3/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.1.0-nullsafety.3/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.1.0-nullsafety.2/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-03-01 16:27:58.177175","version":"1.27.0-4.0.pre"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.0-nullsafety/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.6/","dependencies":[]}],"android":[{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.5.2/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"integration_test","path":"/Users/lorenzopichilli/flutter/packages/integration_test/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.0-nullsafety/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.0-nullsafety.6/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.5-nullsafety/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.1.0-nullsafety.2/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.2.0-nullsafety/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.1.0-nullsafety.3/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.1.0-nullsafety.3/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.1.0-nullsafety.2/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":[]},{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-03-01 20:18:02.273603","version":"1.27.0-4.0.pre"}
31 changes: 31 additions & 0 deletions example/integration_test/webview_flutter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ void main() {
await controller.loadUrl(urlRequest: URLRequest(url: Uri.parse('https://www.google.com/')));
url = await pageLoads.stream.first;
expect(url, 'https://www.google.com/');

pageLoads.close();
});

testWidgets('loadUrl with headers', (WidgetTester tester) async {
Expand Down Expand Up @@ -376,6 +378,9 @@ void main() {
final String content = await controller
.evaluateJavascript(source: 'document.documentElement.innerText');
expect(content.contains('flutter_test_header'), isTrue);

pageStarts.close();
pageLoads.close();
});

group("iOS loadFileURL", () {
Expand Down Expand Up @@ -1282,6 +1287,8 @@ void main() {
await pageLoads.stream.first; // Wait for the next page load.
final String? currentUrl = (await controller.getUrl())?.toString();
expect(currentUrl, 'https://www.google.com/');

pageLoads.close();
});

testWidgets('allow requests on iOS only if iosWKNavigationType == IOSWKNavigationType.LINK_ACTIVATED', (WidgetTester tester) async {
Expand Down Expand Up @@ -1334,6 +1341,8 @@ void main() {
await pageLoads.stream.first; // Wait for the next page load.
currentUrl = (await controller.getUrl())?.toString();
expect(currentUrl, 'https://github.com/pichillilorenzo/flutter_inappwebview');

pageLoads.close();
}, skip: !Platform.isIOS);

testWidgets('can block requests', (WidgetTester tester) async {
Expand Down Expand Up @@ -1382,6 +1391,8 @@ void main() {
.timeout(const Duration(milliseconds: 500), onTimeout: () => null);
final String? currentUrl = (await controller.getUrl())?.toString();
expect(currentUrl, isNot(contains('youtube.com')));

pageLoads.close();
});

testWidgets('supports asynchronous decisions', (WidgetTester tester) async {
Expand Down Expand Up @@ -1428,6 +1439,8 @@ void main() {
await pageLoads.stream.first; // Wait for second page to load.
final String? currentUrl = (await controller.getUrl())?.toString();
expect(currentUrl, 'https://www.google.com/');

pageLoads.close();
});
});

Expand Down Expand Up @@ -1554,6 +1567,8 @@ void main() {
await pageLoads.stream.first;
final String? currentUrl = (await controller.getUrl())?.toString();
expect(currentUrl, 'about:blank');

pageLoads.close();
});

testWidgets(
Expand Down Expand Up @@ -1596,6 +1611,8 @@ void main() {
await controller.goBack();
await pageLoads.stream.first;
expect((await controller.getUrl())?.toString(), contains('flutter.dev'));

pageLoads.close();
},
skip: !Platform.isAndroid,
);
Expand Down Expand Up @@ -3216,6 +3233,8 @@ setTimeout(function() {

final String? currentUrl = (await controller.getUrl())?.toString();
expect(currentUrl, 'https://flutter.dev/');

pageLoads.close();
});

testWidgets('loadFile', (WidgetTester tester) async {
Expand Down Expand Up @@ -3250,6 +3269,8 @@ setTimeout(function() {
expect(url, isNotNull);
expect(url!.scheme, 'file');
expect(url.path, endsWith("test_assets/in_app_webview_initial_file_test.html"));

pageLoads.close();
});

testWidgets('reload', (WidgetTester tester) async {
Expand Down Expand Up @@ -3280,6 +3301,8 @@ setTimeout(function() {
await controller.reload();
url = await pageLoads.stream.first;
expect(url, 'https://flutter.dev/');

pageLoads.close();
});

testWidgets('web history - go back and forward', (WidgetTester tester) async {
Expand Down Expand Up @@ -3364,6 +3387,8 @@ setTimeout(function() {
expect(webHistory.list!.length, 2);
expect(webHistory.list![0].url.toString(), 'https://flutter.dev/');
expect(webHistory.list![1].url.toString(), 'https://github.com/flutter');

pageLoads.close();
});

testWidgets('getProgress', (WidgetTester tester) async {
Expand Down Expand Up @@ -4183,6 +4208,8 @@ setTimeout(function() {
expect(value, isNull);
value = await controller.evaluateJavascript(source: "window.bar;");
expect(value, isNull);

pageLoads.close();
});

testWidgets('saveWebArchive', (WidgetTester tester) async {
Expand Down Expand Up @@ -4260,6 +4287,8 @@ setTimeout(function() {
await controller.loadUrl(urlRequest: URLRequest(url: Uri.parse('http://example.com/')));
await pageLoads.stream.first;
expect(await controller.isSecureContext(), false);

pageLoads.close();
});

test('getDefaultUserAgent', () async {
Expand Down Expand Up @@ -4443,6 +4472,8 @@ setTimeout(function() {

webHistory = await controller.getCopyBackForwardList();
expect(webHistory!.list!.length, 1);

pageLoads.close();
}, skip: !Platform.isAndroid);

test('clearClientCertPreferences', () async {
Expand Down
18 changes: 18 additions & 0 deletions example/ios/Flutter/Flutter.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# NOTE: This podspec is NOT to be published. It is only used as a local source!
# This is a generated file; do not edit or check into version control.
#

Pod::Spec.new do |s|
s.name = 'Flutter'
s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.'
s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => '[email protected]' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
# Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
end
7 changes: 4 additions & 3 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_TARGET=integration_test/webview_flutter_test.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
export "PACKAGE_CONFIG=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/.dart_tool/package_config.json"
2 changes: 1 addition & 1 deletion example/lib/headless_in_app_webview.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class _HeadlessInAppWebViewExampleScreenState extends State<HeadlessInAppWebView
onPressed: () async {
try {
await headlessWebView?.webViewController.evaluateJavascript(source: """console.log('Here is the message!');""");
} on MissingPluginException catch(e) {
} on MissingPluginException {
print("HeadlessInAppWebView is not running. Click on \"Run HeadlessInAppWebView\"!");
}
},
Expand Down
1 change: 0 additions & 1 deletion flutter_inappwebview.iml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,5 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
1 change: 0 additions & 1 deletion ios/Classes/InAppWebView/InAppWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,6 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
let y = Int(scrollView.contentOffset.y / scrollView.contentScaleFactor)
onScrollChanged(x: x, y: y)
}
setNeedsLayout()
lastScrollX = scrollView.contentOffset.x
lastScrollY = scrollView.contentOffset.y
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_inappwebview
description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
version: 5.0.5
version: 5.0.5+1
homepage: https://github.com/pichillilorenzo/flutter_inappwebview

environment:
Expand Down
12 changes: 12 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

readonly SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
readonly PROJECT_DIR="$(dirname $SCRIPT_PATH)"

cd PROJECT_DIR/lib
dartfmt -w .

cd PROJECT_DIR
flutter analyze
flutter pub publish --dry-run
flutter pub publish

0 comments on commit 03a09bf

Please sign in to comment.