cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Braden Shepherdson (JIRA)" <>
Subject [jira] [Commented] (CB-3393) plugin_loader.js and path issue
Date Wed, 15 May 2013 15:39:15 GMT


Braden Shepherdson commented on CB-3393:

Ugh, this is nasty.

It isn't safe to use an absolute path, because it's possible to serve an app from an arbitrary
http:// URL, and the app need not be served from the root of the host.

Since the cordova_plugins.json is at the root of the Cordova project always, no matter where
cordova.js lives on that platform, it would be possible to tweak the loading code in cordova.js
to search for cordova_plugins.json, ../cordova_plugins.json, ../../cordova_plugins.json, etc.,
up maybe three or four levels.

This sucks, but it would solve the problem in the case of putting cordova.js into a subfolder,
or having sub-apps like in mobile-spec.
> plugin_loader.js and path issue
> -------------------------------
>                 Key: CB-3393
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaJS, Plugman
>            Reporter: Steve Gill
>            Assignee: Filip Maj
> Blackberry dudes added a commit to plugin_loader.js that made the path to cordova_plugins.js
absolute. This broke plugin loading for ios + android. See
> I reverted that commit with
> It works again on Android and iOS. Issue that arises now is that cordova.js expects cordova_plugins.json
to be in the same directory as it. If you have cordova.js in a js directory and cordova_plugins.json
exists in a directory above, the plugin will not load because it won't be able to find cordova_plugins.
> Can we reference cordova_plugins in a way that will work across platform?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message