CB-7500 executeScript with callback kills/blurs inAppBrowser window on Android

github close #146
This commit is contained in:
sgrebnov 2016-02-03 22:49:19 +03:00
parent f04f37a617
commit be1f6076c2

View File

@ -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);
}