Thanks Gabriel, Regardless of whether this is the right solution, you can file a defect. I will have a look shortly.
Cheers, Jesse @purplecabbage risingj.com On Mon, Mar 17, 2014 at 1:05 PM, Schulhof, Gabriel < [email protected]> wrote: > Hi! > > 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. > > HTH, > > > > Gabriel > > [0] > https://github.com/jquery/jquery-mobile/issues/6574#issuecomment-37796654 > [1] > https://github.com/apache/cordova-wp8/blob/0f80d8802ce846f062d7bc343a0e46534bdbc7a9/wp8/template/cordovalib/XHRHelper.cs#L194 > [2] > https://github.com/apache/cordova-wp8/blob/0f80d8802ce846f062d7bc343a0e46534bdbc7a9/wp8/template/cordovalib/XHRHelper.cs#L207 > [3] > https://github.com/jquery/jquery-mobile/issues/6574#issuecomment-37801304 >
