Navigation with authority-less URI schemes fail #6599

Closed
datag opened this Issue Oct 11, 2013 · 1 comment

Projects

None yet

1 participant

@datag
datag commented Oct 11, 2013

For URI schemes like qrc: (Qt resource; http://qt-project.org/doc/qt-5.0/qtcore/resources.html) 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 ("Web application wrapper"; http://qt-project.org/doc/qt-4.8/qtwebkit-bridge.html) this resulted in continuously
adding up slashes in front of the path (e.g. "qrc://////index.html") when jQuery Mobile handles navigation. This in turn resulted in a complete page reload for pure anchor links instead of just handling the hash change.

(The issue occured in combination with a application using BackboneJS as a router.)

As this issue can only be fully reproduced in a ThinClient (demo code: http://qt-project.org/doc/qt-4.8/webkit-imageanalyzer.html), no full jsbin testcase is attached.

So what is the issue: The method $.mobile.path.getLocation() incorrectly assumes that the URI's hierarchical part (http://en.wikipedia.org/wiki/URI_scheme) always starts with a double-slash (//). A URI "mailto:foobar@example.com" (which is authority-less, too) might not make much sense when supplied to $.mobile.path.getLocation(). However, for qrc: URIs it's the way resources are addressed in Qt. jQuery mobile alters a qrc:/index.html URI to qrc:///index.html, which does not seem correct to me.


Original pull request is #6597 and commit is e5290d2 (5 tests failed)
Affected versions: at least 1.3.1 until master
Simple testcase: http://jsbin.com/ofuhaw/606/

@gabrielschulhof gabrielschulhof added a commit that referenced this issue Mar 20, 2014
@gabrielschulhof gabrielschulhof Navigation: Do not assume "//" is always part of an absolute URL
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
2ef4621
@gabrielschulhof gabrielschulhof added a commit that referenced this issue Apr 8, 2014
@gabrielschulhof gabrielschulhof Navigation: Do not assume "//" is always part of an absolute URL
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
553317c
@gabrielschulhof gabrielschulhof added a commit that referenced this issue May 29, 2014
@gabrielschulhof gabrielschulhof Navigation: Do not assume "//" is always part of an absolute URL
(cherry picked from commit 9e082b0)

Closes gh-6597
Fixes gh-6574
Fixes gh-6599
ecd5be5
@datag
datag commented May 31, 2014

@gabrielschulhof Awesome, thank you for fixing this issue!

@agcolom agcolom added a commit to agcolom/jquery-mobile that referenced this issue Nov 26, 2014
@gabrielschulhof @agcolom gabrielschulhof + agcolom Navigation: Do not assume "//" is always part of an absolute URL
Closes gh-6597
Fixes gh-6574
Fixes gh-6599
b7b6795
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment