On Tuesday, June 19, 2012, Fabrice Desré wrote:

> On 06/18/2012 04:52 PM, Anant Narayanan wrote:
> > Oh, I apologize, I noticed an error in my original email. This line:
> >
> >> - getInstalled retains its current behaviour when called from an origin
> >> that is not privileged (e.g. an app store).
> >
> > should instead read:
> >
> > - getInstalled will return the list of "natively" installed apps for an
> > origin that is not privileged, but will retain the current behavior in
> > the sense that only apps installed from that origin will be reported.
>
> Thanks Anant,
>
> Trying to summarize:
>
> - For a non privileged page:
>  - getInstalled() returns apps from this origin that are natively
> installed.
>  - getAll() fails.
>  - getSelf() return the app only if it is "natively" installed???
>
> - For a privileged page:
>  - getInstalled() returns apps from any origin that are natively installed.
>  - getAll() returns apps from any origin that are in the DOM registry.
>  - getSelf() returns the app if it is installed in the DOM registry???
>
> On b2g, I guess we should consider all apps in the DOM registry as
> "natively installed". Doesn't this mean that getAll() is useless, since
> a dashboard will ask for privileges and thus can just use getInstalled()
> to get all the apps?
>
> I'd still like to get an explanation on why we do have to manage a
> situation where the DOM registry and the natively installed apps are not
> the same list.


Please let's not create APIs which have different meanings depending on if
the caller is privileged or not. That's just confusing to developers and to
us. And makes future extensions to such APIs even more tricky.

IMHO:
* getInstalled() should *always* just returned the list of apps installed
by the current origin.
* mgmt.getAll() should not be callable from non-privileged callers, and for
privileged callers should return any launchable app. (My understanding is
that only "natively installed" apps are launchable?)
* mgmt.getAllSynced() or some such should return any app which is in the
registry but is not launchable

Would this satisfy all requirements?

This way sync can also improve over time such that it could make a sync'ed
app launchable.

Do we additionally need an API which lets the a privileged app natively
install an app which has been synced but is not natively installed yet? It
seems fairly useless to users if all we can do is to tauntingly display app
icons for apps which have been synced but can't be launched because they
are not natively installed. Or are we just going to grab a link to the
store from the app and then ask the user to re-install the app?

/ Jonas
_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps

Reply via email to