cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AlexMouton <>
Subject [GitHub] cordova-ios pull request: Moved commandQueue push into non-WK_WEBV...
Date Thu, 09 Apr 2015 22:25:23 GMT
GitHub user AlexMouton opened a pull request:

    Moved commandQueue push into non-WK_WEBVIEW_BINDING branch.

    Hi Shazron
    I am working on an html5 video game that is packaged for ios using cordova.
    We were having memory issues with UIWebView and have integrated your work on WKWebView
    Its working great for the performance! thanks! but, we are of course feeling alpha growing
    One thing we have noticed is that when we invoke the cordova Barcode plugin, it is always
called twice!
    I have only looked at the code a short time, but it appears to me that:
    * the first call to Barcode happens, and in iosExec, it gets placed in commandQueue.
    * the first call passes to Objective C world by WKScriptMessageHandler - (void)userContentController:(WKUserContentController*)userContentController
    * this call to Barcode does its thing, completes, and it's javascript response handler
code winds through:
    * in Helper2, the callback is finally passed to a webViewEngine, which processes the Javascript,
and returns, on completion, a list of commands remaining in the javascript commandQueue.
    * these commands are queued on the Obj-C side and run in CDVCommandQueue fashion.
    * since the command was persisted in commandQueue before execution, and not removed, it
is called again!
    I moved the enqueue behavior into the branch that excludes bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING
    This fixes it, but I am not confident its the right solution.
    Do you have any insight into this problem?
    Feedback for my solution?
    A broader or more appropriate venue for the conversation?
    Alex Mouton

You can merge this pull request into a Git repository by running:

    $ git pull CB-8838-wkwebview-double-call

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #136
commit a4ff60b961c567e1de9077474ee76bbf0874341d
Author: Alex Mouton <>
Date:   2015-04-09T22:16:40Z

    Moved commandQueue push into non-WK_WEBVIEW_BINDING branch.


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message