cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Maj (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-11419) Configurable Path For config.xml Fetching In Browser Platform
Date Wed, 19 Jul 2017 19:01:00 GMT

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

Filip Maj commented on CB-11419:
--------------------------------

So I think the issue stems from [this line of code|https://github.com/apache/cordova-browser/blob/master/cordova-js-src/confighelper.js#L69]:

{noformat}
xhr.open("get", "/config.xml", true);
{noformat}

The use of the absolute path is what messes this up.

Perhaps simply removing the slash in front should fix it up. That would then assume the HTML
page and config.xml are in the same directory.

Furthermore, worth investigating how this interacts with the [{{<base>}} element in
the HTML page|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base], which gives
tells the browser what base URL to use with all relative URLs within the page.

> Configurable Path For config.xml Fetching In Browser Platform
> -------------------------------------------------------------
>
>                 Key: CB-11419
>                 URL: https://issues.apache.org/jira/browse/CB-11419
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: cordova-browser
>    Affects Versions: 4.1.0, 4.2.0
>         Environment: Chrome on OS X
>            Reporter: Peter (Somogyvari) Metz
>              Labels: features
>
> 1. Create cordova dummy project
> 2. Add browser platform
> 3. Serve the www dir on anything than the root path of your host, e.g. http://localhost:3000/admin
> 4. Load the application in Chrome (or any browser I assume)
> Cordova tries to load /config.xml which fails with HTTP 404:
> cordova.js:846 [Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml:
Not Found
> I've seen these but none them seem to provide enough flexibility to support my case and
what others have already raised:
> https://issues.apache.org/jira/browse/CB-11274
> https://github.com/apache/cordova-browser/pull/24/commits/8dfd1c7b03b3fb6215888a6d3b1d16ab5c9f316e
> I could send a pull that would examine the global scope for the existence of a getCordovaConfigXmlPath()
method and use the return value if present, but hopefully someone can offer something that
doesn't rely on the global context to work.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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


Mime
View raw message