cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-7992) Weird behavior when more than one <script> tag for cordova.js
Date Mon, 16 Mar 2015 21:49:39 GMT


ASF GitHub Bot commented on CB-7992:

GitHub user purplecabbage opened a pull request:

    CB-7992 prohibit multiple cordova includes

    Verify that window.cordova does not already exist and throw error if it does.
    Tested on ios/android/wp8.

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

    $ git pull CB-7992

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 #104
commit 59bd041f7f8eedad937ad211c6b714901b032ec5
Author: Jesse MacFadyen <>
Date:   2015-03-16T21:42:47Z

    Verify that window.cordova does not already exist and throw error if it does


> Weird behavior when more than one <script> tag for cordova.js
> -------------------------------------------------------------
>                 Key: CB-7992
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.4.0
>            Reporter: Julian Horn
>            Assignee: Julian Horn
>            Priority: Trivial
> If a program has more than one <script> tag for cordova.js, weird behavior ensues.
 This file should protect itself against multiple inclusion; this is a not-uncommon newbie
> The problems I've seen are in the android version of cordova.js, but it's possible that
other platforms have similar problems.
> The weird behavior states with this console message:
> Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2
and lower only.
> Then you see a dialog that says 
> gap:["PluginManager","startup","PluginManager818789619"]
> (OK) (Cancel)
> Without going into all the details, if you click Cancel you live.  If you click OK you
will hang.
> These weird dialogs are put up by this code:
> {code}// file: src/android/android/promptbasednativeapi.js
> define("cordova/android/promptbasednativeapi", function(require, exports, module) {
> /**
>  * Implements the API of, but uses prompt() to communicate.
>  * This is used only on the 2.3 simulator, where addJavascriptInterface() is broken.
>  */
> module.exports = {
>     exec: function(service, action, callbackId, argsJson) {
>         return prompt(argsJson, 'gap:'+JSON.stringify([service, action, callbackId]));
>     },{code}
> This is some kind of error recovery code.  You can probably work out how this gets activated
when I tell you that the console also shows this message:
> Uncaught module cordova/plugin_list already defined

This message was sent by Atlassian JIRA

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

View raw message