On Wed, Feb 20, 2013 at 8:43 PM, <[email protected]> wrote:

> Good afternoon.
> I'm attempting to get appcache working properly with a webapp.
> Following the "Firefox-OS-Boilerplate-App" notes in the index.html file
> I've don the following:
>
> edited the <html> field to say:
> <html manifest="manifest.appcache>
>
> added the .htaccess code from https://github.com/robnyman/**
> Firefox-OS-Boilperlate-App/**blob/gh-pages/.htaccess<https://github.com/robnyman/Firefox-OS-Boilperlate-App/blob/gh-pages/.htaccess>to
>  the .htaccess file at the root of my web pages
>
> added mime type text/application-cache to the .htaccess file at the root
> of my webpages as per notes at http://appcachefacts.info
>
> Also, added the following code to alert that an update is available to the
> app.js file which posts an alert that there is an update and prompts the
> user to reload the page.
>
>     if (window.applicationCache) {
>         applicationCache.**addEventListener('updateready'**, function() {
>                 if (confirm('An update is available. Reload now?')) {
>                 window.location.reload();
>                 }
>         });
>      };
>
> If I understand it right, any change to the manifest.appcache file
> *should* result in updated files being downloaded to the phone/installed
> app/running app.  Then, by reloading the page/app the newer version would
> be used.
>
> Setup as above, if I open the test app in chrome 24 and then making a
> change to the manifest.appcache file and reload the page it does tell me
> there is an update available. the alert pops up and upon reloading i do see
> the changes.
>
> However, in Firefox (version 18 and 19) I don't see the update alert.
>  Also, running on a FFOS device the alert doesn't show either.
>
> I'm confused and certain that i'm missing something pretty simple.
>
> You can see the app at http://trackmyweight.**dragonridersoft.com/**
> TrackMyWeight_FF/<http://trackmyweight.dragonridersoft.com/TrackMyWeight_FF/>
>

In my experience when using appcache and requirejs is tricky due to this
issue:

"onupdateready event not fired when an html5 app cache app is updated"
(https://bugzilla.mozilla.org/show_bug.cgi?id=683794)

you can workaround this issue using this snippet:
https://gist.github.com/rpl/4021284#file-workaround_updateready_bug-html
as suggested in the bugreport.
(I described the issue in more detail is this article:
https://hacks.mozilla.org/2012/11/hacking-firefox-os/)

Btw I'm not sure if b2g presents the same issue.

did you try to app the appcache_path in the manifest?
https://developer.mozilla.org/en-US/docs/Apps/Manifest#appcache_path


> Thank you very much for any help/pointers!
>
>
I hope this helps ;-)


> Wil
>

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

Reply via email to