Closed
Bug 736312
Opened 13 years ago
Closed 13 years ago
navigator.mozApps support on b2g
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: fabrice, Assigned: fabrice)
Details
Attachments
(2 files, 1 obsolete file)
3.30 KB,
text/html
|
Details | |
2.39 KB,
patch
|
vingtetun
:
review+
|
Details | Diff | Splinter Review |
Now that the new API has landed on m-c, we can add the glue to support it on b2g.
This patch enables the API, and maanges the launch() call by dispatching a "webapps-launch: event to the homescreen.
Attachment #606402 -
Flags: review?(21)
Assignee | ||
Comment 1•13 years ago
|
||
Comment 2•13 years ago
|
||
Comment on attachment 606402 [details] [diff] [review]
patch
>diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js
>+
>+WebappsHelper = {
>+ init: function webapps_init() {
>+ Services.obs.addObserver(this, "webapps-launch", false);
The rest of the file use ' instead of "
>+ },
>+
>+ observe: function webapps_observe(aSubject, aTopic, aData) {
the rest of the file do not append the 'a' prefix
>+ let data = JSON.parse(aData);
>+ DOMApplicationRegistry.getManifestFor(data.origin, (function(aManifest) {
>+ if (!aManifest)
>+ return;
nit: add a line break
>+ let manifest = new DOMApplicationManifest(aManifest, data.origin);
>+ shell.sendEvent(content, "webapps-launch", { url: manifest.fullLaunchPath(), origin: data.origin } );
This is the stuff I'm not comfortable with. Is "webapps-launch" event describe somewhere on a spec? I would like to avoid to introduce 'proprietary' events.
>+ }).bind(this));
I don't think you need bind.
We don't have a spec defining how content is supposed to handle launching web apps. We get to define it.
Not too thrilled with the approach here but it works for a v0.
Assignee | ||
Comment 4•13 years ago
|
||
updated patch according to IRC discussion
Attachment #606402 -
Attachment is obsolete: true
Attachment #606402 -
Flags: review?(21)
Assignee | ||
Updated•13 years ago
|
Attachment #606636 -
Flags: review?(21)
Comment 5•13 years ago
|
||
Comment on attachment 606636 [details] [diff] [review]
patch v2
r+ if you fix the comments/nits I have done in the previous comment.
Attachment #606636 -
Flags: review?(21) → review+
Assignee | ||
Comment 6•13 years ago
|
||
Comment 7•13 years ago
|
||
Assignee: nobody → fabrice
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•