[
https://issues.apache.org/jira/browse/CB-7500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15131010#comment-15131010
]
ASF GitHub Bot commented on CB-7500:
------------------------------------
GitHub user sgrebnov opened a pull request:
https://github.com/apache/cordova-plugin-inappbrowser/pull/146
CB-7500 executeScript with callback kills/blurs inAppBrowser window
https://issues.apache.org/jira/browse/CB-7500
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/MSOpenTech/cordova-plugin-inappbrowser CB-7500
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-plugin-inappbrowser/pull/146.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #146
----
commit 2938303cb6298cc7c74d22a2faa0050bdfef292f
Author: sgrebnov <[email protected]>
Date: 2016-02-03T19:49:19Z
CB-7500 executeScript with callback kills/blurs inAppBrowser window after
callback exit
----
> executeScript with callback kills/blurs inAppBrowser window after callback
> exit
> -------------------------------------------------------------------------------
>
> Key: CB-7500
> URL: https://issues.apache.org/jira/browse/CB-7500
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin InAppBrowser
> Affects Versions: 3.5.0
> Environment: Android 4.4.2 Samsung Galaxy Tab S
> Reporter: Andreas Imhof
> Assignee: Sergey Grebnov
> Labels: Android, Triaged, patch
> Original Estimate: 20m
> Remaining Estimate: 20m
>
> Calling Javascript executeScript (inAppBrowser.js) WITH a callback into an
> inAppBrowser window kills/blurs this IAB window after the callback exits.
> Something like this also is mentioned in the author's comment in method
> 'injectDeferredObject' in 'inAppBrowser.java' on line 254.
> After inverstigating, I accidentally found a work-around/solution which
> helped on my Android 4.4.2 Samsung Galagy Tab S.
> SOLUTION:
> In 'inAppBrowser.java' on line 162:
> jsWrapper = String.format("prompt(JSON.stringify([eval(%%s)]),
> 'gap-iab://%s')", callbackContext.getCallbackId());
> the 'prompt' statement should be assigned to a variable like:
> jsWrapper = String.format("var r=prompt(JSON.stringify([eval(%%s)]),
> 'gap-iab://%s')", callbackContext.getCallbackId());
> Adding 'var r=' prevents from InAppBrowser window being killed.
> Don't know why. Tell me... :-)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]