Navigation: Added support for authority-less URI schemes.#6597
Navigation: Added support for authority-less URI schemes.#6597datag wants to merge 1 commit intojquery-archive:masterfrom
Conversation
For URI schemes like "qrc:" (Qt resource) which do not include an authority but only a path the method $.mobile.path.getLocation() incorrectly returns a URL with a double slash after the scheme name. In a Qt Webkit ThinClient application this resulted in continuously adding up slashes in front of the path (e.g. "qrc://////index.html").
|
Just for further clarification, here's my currently used and tested dirty fix for described issue with "qrc:" URI scheme in a Qt ThinClient application - it's not a proper fix for merge: [PATCH] Navigation: Dirty hack for authority-less URI scheme "qrc:"
diff --git a/js/navigation/path.js b/js/navigation/path.js
--- a/js/navigation/path.js
+++ b/js/navigation/path.js
@@ -50,6 +50,11 @@ define([
// mimic the browser with an empty string when the hash is empty
hash = hash === "#" ? "" : hash;
+ // hack for Qt Webkit "qrc:"-scheme
+ if (uri.protocol === "qrc:") {
+ return "qrc:" + uri.pathname + uri.search + hash;
+ }
+
// Make sure to parse the url or the location object for the hash because using location.hash
// is autodecoded in firefox, the rest of the url should be from the object (location unless
// we're testing) to avoid the inclusion of the authority |
|
Can you please open an issue for this describing and reproducing the bug. were we can discuss the issue before deciding on how to fix this. Please see our contributing guidelines for a jsbin template to use to demonstrate. Even if you cant actually reproduce here because of use of thin client it gives us an easily copied and modifiable test page to use. Also not there are 5 failing navigation tests in your PR. were we can discuss the issue before deciding on how to fix this. |
|
Yes, I will open a separate issue as soon as I've prepared a clean testcase. For the moment, one might have a look at a quick testcase simply testing whether jQuery mobile alters a "qrc:/index.html" URI incorrectly to "qrc:///index.html": http://jsbin.com/ukewu3/482 |
|
thank you for that test can you please use the new jsbin test page out of our contributing guidelines https://github.com/jquery/jquery-mobile/blob/master/CONTRIBUTING.md /latest is no longer updated so that is old code now http://jsbin.com/ofuhaw/1/edit Thank you. Also if you have not already can you please sign our CLA http://contribute.jquery.org/CLA/ |
|
x-wmapp0 and x-wmapp1 are also authority-less URL schemes ... |
Note: this does indeed represent a fix for gh-6574, but only once a version of Cordova sporting apache/cordova-wp8#30 is released. Closes gh-6597 Fixes gh-6574 Fixes gh-6599
Note: this does indeed represent a fix for gh-6574, but only once a version of Cordova sporting apache/cordova-wp8#30 is released. Closes gh-6597 Fixes gh-6574 Fixes gh-6599
For URI schemes like "qrc:" (Qt resource) which do not include an
authority but only a path the method $.mobile.path.getLocation()
incorrectly returns a URL with a double slash after the scheme name.
In a Qt Webkit ThinClient application this resulted in continuously
adding up slashes in front of the path (e.g. "qrc://////index.html").
Remark: Please note that I'm currently unable to test this modification (lack of a Qt ThinClient) and this change is untested in its current state. Just let me know whether you're able to reproduce and test or postpone this change until I'm able to do a final test myself.