Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CA2D3D9C0 for ; Wed, 10 Oct 2012 17:53:03 +0000 (UTC) Received: (qmail 67485 invoked by uid 500); 10 Oct 2012 17:53:03 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 67454 invoked by uid 500); 10 Oct 2012 17:53:03 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 67445 invoked by uid 99); 10 Oct 2012 17:53:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Oct 2012 17:53:03 +0000 Date: Wed, 10 Oct 2012 17:53:03 +0000 (UTC) From: "Davide Maestroni (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1497873843.21008.1349891583569.JavaMail.jiratomcat@arcas> Subject: [jira] [Created] (CB-1616) Cordova does not work if current page is not local MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Davide Maestroni created CB-1616: ------------------------------------ Summary: Cordova does not work if current page is not local Key: CB-1616 URL: https://issues.apache.org/jira/browse/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} execXhr.open('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} execXhr.open('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: http://www.atlassian.com/software/jira