From be1f6076c29c3b33bc2cfc968235d852aef095d2 Mon Sep 17 00:00:00 2001 From: sgrebnov Date: Wed, 3 Feb 2016 22:49:19 +0300 Subject: [PATCH] CB-7500 executeScript with callback kills/blurs inAppBrowser window on Android github close #146 --- src/android/InAppBrowser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index 6612a66..7415364 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -200,7 +200,7 @@ public class InAppBrowser extends CordovaPlugin { else if (action.equals("injectScriptCode")) { String jsWrapper = null; if (args.getBoolean(1)) { - jsWrapper = String.format("prompt(JSON.stringify([eval(%%s)]), 'gap-iab://%s')", callbackContext.getCallbackId()); + jsWrapper = String.format("(function(){prompt(JSON.stringify([eval(%%s)]), 'gap-iab://%s')})()", callbackContext.getCallbackId()); } injectDeferredObject(args.getString(0), jsWrapper); }