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