cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
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

    [ https://issues.apache.org/jira/browse/CB-7992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14364032#comment-14364032
] 

ASF GitHub Bot commented on CB-7992:
------------------------------------

GitHub user purplecabbage opened a pull request:

    https://github.com/apache/cordova-js/pull/104

    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 https://github.com/purplecabbage/cordova-js CB-7992

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

    https://github.com/apache/cordova-js/pull/104.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 #104
    
----
commit 59bd041f7f8eedad937ad211c6b714901b032ec5
Author: Jesse MacFadyen <purplecabbage@gmail.com>
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: https://issues.apache.org/jira/browse/CB-7992
>             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
mistake.
> 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 ExposedJsApi.java, 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
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message