You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Juan Sánchez Jurado (JIRA)" <ji...@apache.org> on 2018/08/01 14:49:00 UTC
[jira] [Comment Edited] (CB-13272) Doesn't load config.xml if app
is loaded from a subdirectory
[ https://issues.apache.org/jira/browse/CB-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16565422#comment-16565422 ]
Juan Sánchez Jurado edited comment on CB-13272 at 8/1/18 2:48 PM:
------------------------------------------------------------------
Hi,
Wouldn't it be better if it just requests the file without going into domain root folder?
{code:javascript}
try {
xhr.open("get", "config.xml", true);
xhr.send();
} catch(e) {
fail('[Browser][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
}
{code}
As the rest of browser platform files are requested.
CC/ [~mushu8]
was (Author: jrx_jsj):
Hi,
Wouldn't it be better if it just requests the file without going into domain root folder?
{code:javascript}
try {
xhr.open("get", "/config.xml", true);
xhr.send();
} catch(e) {
fail('[Browser][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
}
{code}
As the rest of browser platform files are requested.
CC/ [~mushu8]
> Doesn't load config.xml if app is loaded from a subdirectory
> ------------------------------------------------------------
>
> Key: CB-13272
> URL: https://issues.apache.org/jira/browse/CB-13272
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-browser
> Affects Versions: cordova@7.0.0
> Environment: Cordova CLI: 7.0.1
> Node: 7.2.1
> Cordova Platforms: android 6.1.2 browser 4.1.0
> Ionic CLI: 3.10.1
> Reporter: Brad Gies
> Priority: Minor
>
> After uploading an app to a subdirectory of a domain i.e. mydomain.com/store/ the app attempts to load the config.xml from the public root i.e. mydomain.com/config.xml instead of mydomain.com/store/config.xml
> Note this is an Ionic 3/Angular 4 app, and built using the command "ionic cordova build browser --prod --release"
> In my uploaded app, the offending line was here:
> (line 875 in my file, function readConfig)
> {code}
> try {
> xhr.open("get", "/config.xml", true);
> xhr.send();
> } catch(e) {
> fail('[Browser][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
> }
> {code}
> Same function on Github:
> https://github.com/apache/cordova-browser/blob/f5df89f99302263fb149c6cec3f5168c0e3c4192/cordova-lib/cordova.js#L894
> https://github.com/apache/cordova-browser/blob/dfa40a685780da5aff9965bd54aafec177113abc/cordova-js-src/confighelper.js#L69
> I could list the URL to view the error here, but that app will change often, and it's easy to reproduce.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org