From 9d5e1f5b898a7b2510762c2d0658cfbaf1c0f889 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Tue, 10 Dec 2019 00:31:32 +0100 Subject: [PATCH] updated shouldOverrideUrlLoading event for #146, added print method and event #128, fix #123 javascript handler for Android API <= 22, renamed onTargetBlank to onCreateWindow event, deleted useOnTargetBlank option, added supportMultipleWindows android option, added getDefaultUserAgent static method, Updated default value for domStorageEnabled option to true --- .idea/workspace.xml | 106 +++++++++++------- README.md | 3 +- .../lib/in_app_browser_example.screen.dart | 7 +- 3 files changed, 70 insertions(+), 46 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index dc6be062..e6f8abf6 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -15,9 +15,8 @@ - - - + + @@ -37,7 +36,7 @@ - + @@ -49,6 +48,18 @@ + + + + + + + + + + + + @@ -97,11 +108,11 @@ - + - - + + @@ -216,7 +227,6 @@ @@ -296,6 +307,17 @@ + + + + + + + + + + + @@ -464,7 +486,7 @@ - + @@ -483,7 +505,7 @@ - + @@ -792,16 +814,6 @@ - - - - - - - - - - @@ -863,27 +875,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -901,6 +892,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index fd698ca4..94f39454 100644 --- a/README.md +++ b/README.md @@ -502,9 +502,10 @@ class MyInAppBrowser extends InAppBrowser { } @override - void shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) { + Future shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async { print("\n\n override ${shouldOverrideUrlLoadingRequest.url}\n\n"); this.webViewController.loadUrl(url: shouldOverrideUrlLoadingRequest.url); + return ShouldOverrideUrlLoadingAction.CANCEL; } @override diff --git a/example/lib/in_app_browser_example.screen.dart b/example/lib/in_app_browser_example.screen.dart index cf40d639..632c8829 100644 --- a/example/lib/in_app_browser_example.screen.dart +++ b/example/lib/in_app_browser_example.screen.dart @@ -37,9 +37,10 @@ class MyInAppBrowser extends InAppBrowser { } @override - void shouldOverrideUrlLoading(String url, Map headers, bool isForMainFrame) { - print("\n\n override $url\n\n"); - this.webViewController.loadUrl(url: url); + Future shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async { + print("\n\n override ${shouldOverrideUrlLoadingRequest.url}\n\n"); + this.webViewController.loadUrl(url: shouldOverrideUrlLoadingRequest.url); + return ShouldOverrideUrlLoadingAction.CANCEL; } @override