On Thu, Jun 7, 2012 at 12:52 AM, Anant Narayanan <[email protected]> wrote:

> On 06/06/2012 06:54 PM, Jonas Sicking wrote:
>
>> I don't really understand what change is being proposed here. Doesn't
>> getInstalled already return the list of applications installed through
>> the store which is calling getInstalled?
>>
>> In other words, what specifically is the problem with the current API?
>>
>
> There is no way in the current API to distinguish between apps that have
> been installed and apps that have been "acquired" (not quite the same as
> installed) and do not have a native launch target.
>
> Therefore the proposal is to modify getInstalled to return a list of apps
> that have launch targets on the current platform, *only* when called in a
> privileged context like a dashboard. getInstalled will continue to work as
> currently defined for regular origins like stores.


I think getInstalled is little bit of a red herring – it means "things this
site installed".  More generally, underlying mozApps is a single list of
applications that either exist (and so are installed) or don't exist in
that list.

I've been thinking about this a little, and I think it might make sense to
distinguish between applications that *could* exist (i.e., everything in
the cloud), and applications are installed locally, or installed on other
particular devices.

One thought I had is that we could have mozApps.getAllRemote() (and
getInstalledRemote()) that gives all the app objects that exist, whether or
not they are installed.  Applications objects would have a property
indicating their local install status, and an .install() method.
.uninstall() means uninstall locally.  Maybe a new method could be added
that means remove from the cloud.

That idea only adds the idea of the cloud and locally.  Another feature
that's wanted, though lower priority, is to be able to see all your devices
and "install" apps on other devices (in practice this would really mean
"ask the other device to install the app next time it checks").  You could
imagine something like mozApps.mgmt.getAllDevices(), and each device might
have a device.install(app) function.  We could include the local app as a
device, and leave normal install/uninstall to mean global/cloud
installation, and then do localDevice.install(app) to mean install a device
locally.  Seems a little indirect, and local installation is distinctly
different from remote installation because it actually succeeds and is
confirmable while remote installation is not.  You'd need some property to
determine which devices an app was installed on.  You could have multiple
local containers – e.g., install natively or install into the browser, or
install into another browser, etc.  (In this case a better name than
"device" might be "user agent".)  It could allow userAgent.launch(app) too,
if you want to support launching in the browser or natively, etc.  But
trying to combine local and remote user agents into one API seems iffy to
me.
_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps

Reply via email to