The default bug view has changed. See this FAQ.

Add 'localeId' to WebApps registry

RESOLVED FIXED in mozilla16

Status

()

Core
DOM: Apps
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mounir, Assigned: mounir)

Tracking

Trunk
mozilla16
Points:
---

Firefox Tracking Flags

(blocking-basecamp:+)

Details

(Whiteboard: [qa-])

Attachments

(2 attachments)

(Assignee)

Description

5 years ago
Created attachment 639033 [details] [diff] [review]
Patch

This is needed so we have a simple and short ID for apps. UUID should only be used to identify app for sync purpose.
Attachment #639033 - Flags: review?(fabrice)
(Assignee)

Comment 1

5 years ago
Comment on attachment 639033 [details] [diff] [review]
Patch

Renaming - autocomplete has been quite smart...
Attachment #639033 - Attachment description: Patch v1 - Fix the bug for html content → Patch
(Assignee)

Updated

5 years ago
Blocks: 770831
Comment on attachment 639033 [details] [diff] [review]
Patch

Review of attachment 639033 [details] [diff] [review]:
-----------------------------------------------------------------

What you have there is fine, except that if we already have webapps installed without a localId they won't get one.
Can you check at http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.jsm#62 that apps have localIds and add them if they are missing?

r=me with that.

::: dom/apps/src/AppsService.js
@@ +39,5 @@
>    classInfo : XPCOMUtils.generateCI({classID: APPS_SERVICE_CID,
>                                       contractID: APPS_SERVICE_CONTRACTID,
>                                       classDescription: "AppsService",
>                                       interfaces: [Ci.nsIAppsService],
>                                       flags: Ci.nsIClassInfo.DOM_OBJECT})

You don't need all this classInfo stuff.
Attachment #639033 - Flags: review?(fabrice) → review+
(Assignee)

Comment 3

5 years ago
Created attachment 639714 [details] [diff] [review]
Create localId if not present

Fabrice, is that what you were expecting?

Also, I didn't get your comment about the classinfo stuff. I haven't touched that.
Attachment #639714 - Flags: review?(fabrice)
(Assignee)

Comment 4

5 years ago
Also, the Gaia pull request is ready:
https://github.com/mozilla-b2g/gaia/pull/2233
Attachment #639714 - Flags: review?(fabrice) → review+
(In reply to Mounir Lamouri (:mounir) from comment #3)

> Also, I didn't get your comment about the classinfo stuff. I haven't touched
> that.

This is because you ignored https://bugzilla.mozilla.org/show_bug.cgi?id=754141#c5 in the first place ;)
(Assignee)

Comment 6

5 years ago
(In reply to Fabrice Desré [:fabrice] from comment #5)
> (In reply to Mounir Lamouri (:mounir) from comment #3)
> 
> > Also, I didn't get your comment about the classinfo stuff. I haven't touched
> > that.
> 
> This is because you ignored
> https://bugzilla.mozilla.org/show_bug.cgi?id=754141#c5 in the first place ;)

Bug 772050.
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/104a6456639e
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Is this possible to verify at the JS API level?
Whiteboard: [qa?]
(Assignee)

Comment 9

5 years ago
You can use AppsService to get the localId of an installed app. However, you need to be a privileged content to access this service.

Note that we should be able to simple automatic tests for this when bug 770894 will be done.
(In reply to Mounir Lamouri (:mounir) from comment #9)
> You can use AppsService to get the localId of an installed app. However, you
> need to be a privileged content to access this service.
> 
> Note that we should be able to simple automatic tests for this when bug
> 770894 will be done.

See my comment in bug 770894. There's already a capability to write automated tests for the mozapps API on m-c.

Updated

5 years ago
Whiteboard: [qa?] → [qa+]
(In reply to Mounir Lamouri (:mounir) from comment #9)
> You can use AppsService to get the localId of an installed app. However, you
> need to be a privileged content to access this service.

What do you mean by privileged content?

On my localhost, I just installed an app and did the following below, but I got "undefined" when I accessed localId:

var request = window.navigator.mozApps.getSelf();  
request.onsuccess = function() {  
        // Pull the name of the app out of the App object  
	alert("App Result Test: " + request.result.localId);  
};  
request.onerror = function() {  
	// Display error name from the DOMError object  
	alert("Error: " + request.error.name);  
};
(In reply to Jason Smith [:jsmith] from comment #11)
> (In reply to Mounir Lamouri (:mounir) from comment #9)
> > You can use AppsService to get the localId of an installed app. However, you
> > need to be a privileged content to access this service.
> 
> What do you mean by privileged content?
> 
> On my localhost, I just installed an app and did the following below, but I
> got "undefined" when I accessed localId:
> 
> var request = window.navigator.mozApps.getSelf();  
> request.onsuccess = function() {   
> 	alert("App Result Test: " + request.result.localId);  
> };  
> request.onerror = function() {  
> 	// Display error name from the DOMError object  
> 	alert("Error: " + request.error.name);  
> };

Slight fix on the above code: Ignore the comment above the first alert (bad copy and paste on my part).

Updated

5 years ago
Whiteboard: [qa+] → [qa?]
(In reply to Jason Smith [:jsmith] from comment #11)
> (In reply to Mounir Lamouri (:mounir) from comment #9)
> > You can use AppsService to get the localId of an installed app. However, you
> > need to be a privileged content to access this service.
> 
> What do you mean by privileged content?

This is "chrome" privileged code. This property is not exposed to web content, so there's no way to test anything from an html page.

Updated

5 years ago
Whiteboard: [qa?] → [qa-]
blocking-basecamp: ? → +

Updated

5 years ago
Component: DOM: Mozilla Extensions → DOM: Apps
You need to log in before you can comment on or make changes to this bug.