Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

isCrossDomainPageLoad check is missing protocol values #4845

Closed
zathrus-writer opened this issue Aug 14, 2012 · 4 comments
Closed

isCrossDomainPageLoad check is missing protocol values #4845

zathrus-writer opened this issue Aug 14, 2012 · 4 comments

Comments

@zathrus-writer
Copy link

this line of isCrossDomainPageLoad check from jQuery Mobile 1.1.0 is missing a few values, preventing links to be automatically handled via the changePage() function:

isCrossDomainPageLoad = ( $.mobile.allowCrossDomainPages && documentUrl.protocol === "file:" && href.search( /^https?:/ ) != -1 ),

to fix this for BlackBerry and Windows Phone 7 at least, it should read:

isCrossDomainPageLoad = ( $.mobile.allowCrossDomainPages && (documentUrl.protocol === "file:" || documentUrl.protocol === "x-wmapp1:" || documentUrl.protocol === "local:") && href.search( /^https?:/ ) != -1 ),

@gabrielschulhof
Copy link

Is this still an issue? Are there platforms where we're handling links via HTTP instead of handling them via Ajax?

@gabrielschulhof
Copy link

The decision as to whether a request is cross-domain or not has been moved to path.js.

@Ruffio
Copy link

Ruffio commented Dec 30, 2014

@gabrielschulhof Is this issue still relevant?

I find this in the code:

isPermittedCrossDomainRequest: function( docUrl, reqUrl ) {
return $.mobile.allowCrossDomainPages &&
(docUrl.protocol === "file:" || docUrl.protocol === "content:") &&
reqUrl.search( /^https?:/ ) !== -1;
}

@gabrielschulhof
Copy link

Unforunately, it's difficult to test on either Windows or Blackberry. I've gone through the pain of doing Cordova on Windows when fixing #6574, and I believe I've burned up my free Windows development time in the process ... and I can't get the Blackberry simulator running on Linux for the life of me, especially since VMware has gone all out to require licenses and stuff.

If anyone has a setup for doing Cordova on Windows and/or Blackberry, please create a jQuery Mobile project consisting of two documents which link to one another. Then click the link which leads to the other document. This should cause jQuery Mobile to attempt to load the other document via Ajax. If this fails on either platform, please comment here. We can then debug together. TIA!

@apsdehal apsdehal closed this as completed Jul 7, 2016
@apsdehal apsdehal self-assigned this Aug 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants