bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Packaged apps URL doesn't comply with the RFC3986



Core Graveyard
DOM: Apps
5 years ago
5 months ago


(Reporter: arnaud, Unassigned)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



5 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0) Gecko/20130131 Firefox/20.0
Build ID: 20130131094657

Steps to reproduce:

While debugging an angularjs packaged app in r2d2b2g I noticed that window.location.href was "app://{550e8400-e29b-41d4-a716-446655440000}/index.html".

Actual results:

Strict URL regexes cannot parse the packaged app URL, AngularJS router for example (https://github.com/angular/angular.js/blob/v1.1.3/src/ng/location.js#L3). Other libs/frameworks may have the same problem.

Expected results:

Packaged apps URL should not contain curly braces. Actually, I think it doesn't comply with the RFC3986 http://tools.ietf.org/html/rfc3986#page-21  

There is no occurence of them in the documentation :

- https://developer.mozilla.org/en-US/docs/Apps/Packaged_apps
- https://wiki.mozilla.org/Apps/Security

Thanks for your help !
Jonas & Fabrice - Any thoughts here?
That looks right, and the change is trivial on our side. What I'm most surprised with is that our URL parser doesn't choke at all on our current URLs if they are invalid.

Comment 3

5 years ago
Created attachment 718804 [details] [diff] [review]
webapp id patch

Too trivial maybe ? I'm not sure about the impact of changing the app id syntax.

I haven't launched the test suite but rebuilt and installed an app from the market without any problem so far. app.origin is now correct.
Comment on attachment 718804 [details] [diff] [review]
webapp id patch

Review of attachment 718804 [details] [diff] [review]:

::: dom/apps/src/Webapps.jsm
@@ +1982,4 @@
>    makeAppId: function() {
>      let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
> +    return uuidGenerator.generateUUID().toString().slice(1,-1);

Nit: slice(1, -1);
Attachment #718804 - Flags: review+
Keywords: checkin-needed
Keywords: checkin-needed


5 years ago
Ever confirmed: true


5 months ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.