Last Comment Bug 764091 - Accessing mozApps manifest properties need __exposedProps__ set correctly
: Accessing mozApps manifest properties need __exposedProps__ set correctly
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Apps (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla16
Assigned To: [:fabrice] Fabrice Desré
:
Mentors:
Depends on: 760109
Blocks: 553102 746465
  Show dependency treegraph
 
Reported: 2012-06-12 12:07 PDT by Ed Lee :Mardak
Modified: 2012-07-28 09:31 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (1.83 KB, patch)
2012-06-15 17:09 PDT, [:fabrice] Fabrice Desré
21: review+
Details | Diff | Review

Description Ed Lee :Mardak 2012-06-12 12:07:27 PDT
From bug 553102:

(In reply to Edward Lee :Mardak from comment #100)
> Fabrice, it also seems like each object level needs to have __exposedProps__
> because accessing this.result.manifest.name from getSelf() triggers the
> warning. (Test by running the following on an origin with an app installed.)
> 
> navigator.mozApps.getSelf().onsuccess = function() this.result.manifest.name

Oh, I thought we didn't need that for plain jsvals...
Comment 1 Kyle Huey [:khuey] (khuey@mozilla.com) 2012-06-12 14:05:44 PDT
Can you create the relevant objects in the content compartment?
Comment 2 [:fabrice] Fabrice Desré 2012-06-12 14:08:59 PDT
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #1)
> Can you create the relevant objects in the content compartment?

Is there a way to do that in chrome JS?
Comment 3 Kyle Huey [:khuey] (khuey@mozilla.com) 2012-06-12 14:13:43 PDT
https://developer.mozilla.org/en/Components.utils.createObjectIn
Comment 4 [:fabrice] Fabrice Desré 2012-06-15 17:09:15 PDT
Created attachment 633730 [details] [diff] [review]
patch

This patch removes the manifest-related warnings, and also the one fired when returning arrays of apps.
Comment 5 Ed Lee :Mardak 2012-06-15 17:58:01 PDT
I'm not sure if I'm the right person to be reviewing this, but do we want a general purpose wrapObjectIn or should we be explicit in what we expose from the manifest? Would being explicit just involve setting an __exposedProps__ hash of readable properties?
Comment 6 [:fabrice] Fabrice Desré 2012-06-15 18:08:54 PDT
(In reply to Edward Lee :Mardak from comment #5)
> I'm not sure if I'm the right person to be reviewing this, but do we want a
> general purpose wrapObjectIn or should we be explicit in what we expose from
> the manifest? Would being explicit just involve setting an __exposedProps__
> hash of readable properties?

There are two issues with this approach:
- we need to take care of nested structures in the manifest (eg, icons, authors, locales) and this will be very painful without introspecting.
- the manifest structure is not stable, and can potentially have extension points, so it's hard to whitelist only the properties we want.
Comment 7 [:fabrice] Fabrice Desré 2012-06-20 21:13:08 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/ddd52f236159
Comment 8 Ed Morley [:emorley] 2012-06-21 04:02:47 PDT
https://hg.mozilla.org/mozilla-central/rev/ddd52f236159

Note You need to log in before you can comment on or make changes to this bug.