From 3b6757fc4407aa5cd9d5cbda3ff2f8174ecdae1a Mon Sep 17 00:00:00 2001 From: Niklas Merz Date: Wed, 10 Feb 2021 18:11:21 +0100 Subject: [PATCH 1/3] Incremented plugin version. (cordova-plugin-inappbrowser-5.0.0) --- package.json | 2 +- plugin.xml | 2 +- tests/package.json | 2 +- tests/plugin.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 2838435a6..4b27e701b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-inappbrowser", - "version": "5.0.0", + "version": "5.0.1-dev", "description": "Cordova InAppBrowser Plugin", "types": "./types/index.d.ts", "cordova": { diff --git a/plugin.xml b/plugin.xml index 6e06ac505..d061c700e 100644 --- a/plugin.xml +++ b/plugin.xml @@ -20,7 +20,7 @@ + version="5.0.1-dev"> InAppBrowser Cordova InAppBrowser Plugin diff --git a/tests/package.json b/tests/package.json index 729e6c0ae..dd735b5c8 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-inappbrowser-tests", - "version": "5.0.0", + "version": "5.0.1-dev", "description": "", "cordova": { "id": "cordova-plugin-inappbrowser-tests", diff --git a/tests/plugin.xml b/tests/plugin.xml index e250ad765..08eb791b6 100644 --- a/tests/plugin.xml +++ b/tests/plugin.xml @@ -20,7 +20,7 @@ + version="5.0.1-dev"> Cordova InAppBrowser Plugin Tests Apache 2.0 From 2fef3046fcdbba301de637e200edba46d6f54052 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Fri, 11 Jun 2021 14:25:43 +0200 Subject: [PATCH 2/3] fix(ios): make system open tel, sms, mailto and geo links (#881) --- src/ios/CDVWKInAppBrowser.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ios/CDVWKInAppBrowser.m b/src/ios/CDVWKInAppBrowser.m index cf4b6f612..2adcf0c1b 100644 --- a/src/ios/CDVWKInAppBrowser.m +++ b/src/ios/CDVWKInAppBrowser.m @@ -539,8 +539,9 @@ - (void)webView:(WKWebView *)theWebView decidePolicyForNavigationAction:(WKNavig [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId]; } - //if is an app store link, let the system handle it, otherwise it fails to load it - if ([[ url scheme] isEqualToString:@"itms-appss"] || [[ url scheme] isEqualToString:@"itms-apps"]) { + //if is an app store, tel, sms, mailto or geo link, let the system handle it, otherwise it fails to load it + NSArray * allowedSchemes = @[@"itms-appss", @"itms-apps", @"tel", @"sms", @"mailto", @"geo"]; + if ([allowedSchemes containsObject:[url scheme]]) { [theWebView stopLoading]; [self openInSystem:url]; shouldStart = NO; From e669dc3144bd66e313f0a1ae6903ce6ca27077e9 Mon Sep 17 00:00:00 2001 From: Alessandro Basso Date: Wed, 16 Jun 2021 10:34:00 -0400 Subject: [PATCH 3/3] Android - Fix for webView window not being destroyed correctly causing memory leak (https://github.com/apache/cordova-plugin-inappbrowser/issues/290) --- src/android/InAppBrowser.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index 479e04cd7..6e44803a7 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -534,6 +534,16 @@ public void onPageFinished(WebView view, String url) { dialog.dismiss(); dialog = null; } + + // Fix for webView window not being destroyed correctly causing memory leak + // (https://github.com/apache/cordova-plugin-inappbrowser/issues/290) + if (url.equals(new String("about:blank"))) { + inAppWebView.onPause(); + inAppWebView.removeAllViews(); + inAppWebView.destroyDrawingCache(); + inAppWebView.destroy(); + inAppWebView = null; + } } }); // NB: From SDK 19: "If you call methods on WebView from any thread