From 78350c3bbd9d24f38ddb66c49060497f163ce687 Mon Sep 17 00:00:00 2001 From: Adrian Pike Date: Wed, 16 Nov 2011 14:58:00 -0800 Subject: [PATCH] Fixed #2234 - form hijacking wasn't respecting allowCrossDomainPages, now it does! --- js/jquery.mobile.navigation.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 5e3cc358edd..c533a285de0 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -1230,8 +1230,10 @@ define( [ url = path.makeUrlAbsolute( url, getClosestBaseUrl($this) ); - //external submits use regular HTTP - if( path.isExternal( url ) || target ) { + // More info about what's going on here is up in useDefaultUrlHandling in the Click routing. + // Basically if we loaded via file:// and we've got "allowCrossDomainPages" true, we should use changePage. + isCrossDomainPageLoad = ( $.mobile.allowCrossDomainPages && documentUrl.protocol === "file:"); + if(( path.isExternal( url ) && !isCrossDomainPageLoad) || target ) { return; }