On Sat, Mar 16, 2013 at 8:31 PM, Toni Hermoso Pulido <[email protected]
> wrote:

> Al 16/03/13 18:49, En/na Luca Greco ha escrit:
> > Currently FirefoxOS doesn't allow reinstall from the same origin:
> > https://bugzilla.mozilla.org/show_bug.cgi?id=821288
> >
> > It means that on a production device it is not possible to reinstall an
> > already installed app and:
> >  - hosted apps updates their content like any webapp (e.g. close and
> reopen
> > the app or
> >    window.location.reload, and optionally using applicationCache
> > methods/events)
> >  - packaged apps update procedure is managed from the
> > Application.checkForUpdate
> >    method (https://developer.mozilla.org/en-US/docs/DOM/app)
> >
> > During your development iterations you can add the app in the FirefoxOS
> > Simulator
> > dashboard and force app updates using the "Update button",
> > as you can see in this screencast:
> > http://www.youtube.com/watch?v=Py8FCadnOH8
>
> Grazie Luca,
>
> so, as far as I understand, now it's not possible to change manifest
> properties (for update, specially version) of installed hosted apps, is it?
>
>
Currently on the "App" MDN doc page, checkForUpdate is reported as a
"packaged app"-only
method for update, but I've looked to the source and it seems to do exactly
what you need
(update app manifest) on a hosted app:

https://mxr.mozilla.org/mozilla-b2g18/source/dom/apps/src/Webapps.jsm#1352

So, once an hosted app is installed on a device, it can be updated using
"checkForUpdate",
where "app" is the object you get from "mozApps.getSelf" (if your code is
running in the app),
or mozApps.getInstalled (if your code is running on the install page):
- https://developer.mozilla.org/en-US/docs/DOM/Apps.getSelf
- https://developer.mozilla.org/en-US/docs/DOM/Apps.getInstalled

-- 
Luca Greco @ Alca Società Cooperativa
Follow me on http://twitter.com/lucagreco
_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps

Reply via email to