Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2FFC6118FB for ; Tue, 9 Sep 2014 15:52:29 +0000 (UTC) Received: (qmail 34979 invoked by uid 500); 9 Sep 2014 15:52:28 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 34958 invoked by uid 500); 9 Sep 2014 15:52:28 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 34943 invoked by uid 99); 9 Sep 2014 15:52:28 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2014 15:52:28 +0000 Date: Tue, 9 Sep 2014 15:52:28 +0000 (UTC) From: "Andreas Imhof (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-7500) executeScript with callback kills/blurs inAppBrowser window after callback exit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-7500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andreas Imhof updated CB-7500: ------------------------------ Description: 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... :-) was: Calling Javascript executeScript (inAppBrowser.js) WITH a callback into an inAppBrowser window kills/blurs this IAB window after the callback exits. Somethink 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... :-) > 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: Android > Affects Versions: 3.5.0 > Environment: Android 4.4.2 Samsung Galaxy Tab S > Reporter: Andreas Imhof > Labels: 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)