Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

$location broken for packaged FirefoxOS App-URLs #2112

Closed
Schibum opened this issue Mar 7, 2013 · 3 comments
Closed

$location broken for packaged FirefoxOS App-URLs #2112

Schibum opened this issue Mar 7, 2013 · 3 comments

Comments

@Schibum
Copy link
Contributor

Schibum commented Mar 7, 2013

FirefoxOS uses special URLs like app://{d0419af1-8b42-41c5-96f4-ef4179e52315}/index.html for packaged Apps.

The current URL_MATCH regexp in ng/location.js does not recognize such URLs which causes an error in matchURL() that effectively breaks bootstrapping.

Adding {} to the host-capture clause of the regular expression fixes this. I.e. changing

var URL_MATCH = /^([^:]+):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,

to:

var URL_MATCH = /^([^:]+):\/\/(\w+:{0,1}\w*@)?([\{\}\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,
Schibum added a commit to Schibum/angular.js that referenced this issue Mar 7, 2013
FirefoxOS uses special URLs like
app://{d0419af1-8b42-41c5-96f4-ef4179e52315}/index.html for packaged Apps.

Closes angular#2112
@IgorMinar
Copy link
Contributor

according to my information the url looks more like app://550e8400-e29b-41d4-a716-446655440000/index.html which means that we don't need to change anything.

can you point me to some spec that specifies the url format?

this is what I looked at:

@Schibum
Copy link
Contributor Author

Schibum commented Mar 12, 2013

I don't know about the specs but I installed a packaged app on my test
device (bpoot2gecko 1.1.0.0-prerelease) and that's how window.location
looked like. Same in the simulator.

mhevery pushed a commit to mhevery/angular.js that referenced this issue Mar 16, 2013
FirefoxOS uses special URLs like
app://{d0419af1-8b42-41c5-96f4-ef4179e52315}/index.html for packaged Apps.

Closes angular#2112
@colinfrei
Copy link
Contributor

See also this Firefox OS bug for reference: https://bugzilla.mozilla.org/show_bug.cgi?id=845344
Since curly brackets aren't actually valid, and this was fixed in Firefox OS, it might make sense to remove this again at some point.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants