cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schulhof, Gabriel" <>
Subject WP7 and WP8 x-wmapp URL scheme special casing
Date Mon, 17 Mar 2014 20:05:45 GMT

In jQuery Mobile we've encountered a bug[0] in the way Cordova parses
these URLs. In fact, when XHRLOCAL notification handler receives an
absolute URL such as, for instance, x-wmapp0://www/filename.html, it
passes the path to the file reader incorrectly. The resulting path
cannot be found, and the Ajax request ultimately fails.

The problem is that the code at [1] is designed to remove the leading
"/" which is causing the problem, but that code assumes that the URL
does not start with the protocol.

In [0] I provide a changeset that strips the protocol portion of the
URL so that the code at [1] can perform the desired function, which is
to strip the initial "/" so that the Ajax request can then be
correctly fulfilled. The protocol is re-added by the existing code at
[2] later on.

Before filing a bug and submitting a PR, I would like to discuss
whether you think this modification might be the right way to fix
this, especially since the bug is not necessarily exclusive to jQuery
Mobile alone. In fact, I provide an example[3] that illustrates how
the error might crop up with just plain JS.




View raw message