diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-09-21 18:43:03 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-09-21 18:43:03 +0200 |
| commit | 7f6c5134780ad3cedc718772b40578f0170f200e (patch) | |
| tree | 15a120d91855ae66f42111e05f696e5600a9b832 /StoneIsland/plugins/cordova-plugin-inappbrowser/src/android/InAppChromeClient.java | |
| parent | 853bd5fa85812316a72b2f5ce755dc0facb91932 (diff) | |
cordova-plugin-inappbrowser welcome to the family!!
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-inappbrowser/src/android/InAppChromeClient.java')
| -rw-r--r-- | StoneIsland/plugins/cordova-plugin-inappbrowser/src/android/InAppChromeClient.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/StoneIsland/plugins/cordova-plugin-inappbrowser/src/android/InAppChromeClient.java b/StoneIsland/plugins/cordova-plugin-inappbrowser/src/android/InAppChromeClient.java index a2145e6a..fe5dd349 100644 --- a/StoneIsland/plugins/cordova-plugin-inappbrowser/src/android/InAppChromeClient.java +++ b/StoneIsland/plugins/cordova-plugin-inappbrowser/src/android/InAppChromeClient.java @@ -104,7 +104,7 @@ public class InAppChromeClient extends WebChromeClient { if(defaultValue.startsWith("gap-iab://")) { PluginResult scriptResult; String scriptCallbackId = defaultValue.substring(10); - if (scriptCallbackId.startsWith("InAppBrowser")) { + if (scriptCallbackId.matches("^InAppBrowser[0-9]{1,10}$")) { if(message == null || message.length() == 0) { scriptResult = new PluginResult(PluginResult.Status.OK, new JSONArray()); } else { @@ -118,9 +118,14 @@ public class InAppChromeClient extends WebChromeClient { result.confirm(""); return true; } + else { + // Anything else that doesn't look like InAppBrowser0123456789 should end up here + LOG.w(LOG_TAG, "InAppBrowser callback called with invalid callbackId : "+ scriptCallbackId); + result.cancel(); + return true; + } } - else - { + else { // Anything else with a gap: prefix should get this message LOG.w(LOG_TAG, "InAppBrowser does not support Cordova API calls: " + url + " " + defaultValue); result.cancel(); |
