incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davide Maestroni (JIRA)" <>
Subject [jira] [Created] (CB-1616) Cordova does not work if current page is not local
Date Wed, 10 Oct 2012 17:53:03 GMT
Davide Maestroni created CB-1616:

             Summary: Cordova does not work if current page is not local
                 Key: CB-1616
             Project: Apache Cordova
          Issue Type: Bug
          Components: CordovaJS, iOS
    Affects Versions: 2.1.0
         Environment: iOS 5.x, 6.x
            Reporter: Davide Maestroni
            Assignee: Filip Maj
            Priority: Blocker

I implemented an iOS application using Cordova 2.1.0, which, at startup, loads a remote web
page with the _cordova-2.1.0.js_ file included in a tag "script". In this case the communication
with the device fails and no Cordova plugin is accessible.
After investigating the issue, I found out the root cause in the following line:
{noformat}  'HEAD', "file:///!gap_exec", true);{noformat}
Basically, the problem here is that the above request never reaches the device if the location
of the window does not start with "file://", which is exactly my case.
In order to fix that, I tried to modify the above line as follows:
{noformat}  'HEAD', window.location.origin + "/!gap_exec", true);{noformat}
And now it works great on any iOS device.

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