I have been fooling with using both a html 5 and firefox app and
manifest.
<html manifest="MEvaluator-CalculatorApp.appcache">
When I am cached as an html5 app, it disallows or otherwise whacks the
XMLHttpRequest
I add a couple more checks to the code to let me know that I did not
update the Firefox app manifest
if(this.readyState === 4 && (this.status === 0 || + this.status
=== 200))
{
if(this.status==0 && this.statusText==null)
{
alert("Check for Firefox app update -> Request was not
allowed ");
return;
}
if (this.responseText==null || this.responseText=="") //data
null or failure
{
alert("Check for Firefox app update did not receive
manifest, probably request not sent " + this.statusText );
return;
}
My understanding is when you open the web page in the browser (File ,
Open) you are using File protocol, not http protocol and one of the
sandboxing rules is
don't let files from this origin request files from the web. At this
time,it looks to me like this is enforced for HTML 5 cached files.
Once I have download a FireFox / HTML 5 app, the browser does its job
of keeping the html5 cache up to date; however, getting at the FireFox
manifest back at the origin is not possible.
I am not sure of what I can do to keep things in synch. I suppose 1
option would be to HTML 5 cache most things, but keep something on the
server so that you can initiate a valid XMLHttpRequest, but in my
case, I have fairly trivial (but useful) web pages / applications and
sending traffic to the web site serves not purpose other than keeping
the Firefox app version / manifest in synch with the rest of the
app.
Since html5 caching keeps the app up to date, I suppose I could but a
link somewhere that says check for Firefox app update, but again, I am
sending traffic just to keep the Firefox app version number current.
I don't think this is a show stopper. Its great to have the app store
to promote the app. I would like to figure the low cost / low traffic
way of keeping things in synch.
Could it be as simple as having the browser check for a corresponding
webapp for an appcache file and triggering something which could
initiate the whatever the app install / update process would be? I
don't see any great need to do this either, but it does close the gap
on the html5 and firefox app conventions.
===========
var MANIFEST = '/XXSoftwareTools/Mvaluator-CalculatorApp.webapp';
req = new XMLHttpRequest();
req.open('GET', MANIFEST);
req.onreadystatechange = function () {
if (req.readyState != 4) {
return;
}
var appManifest = JSON.parse(req.responseText);
navigator.mozApps.amInstalled(function (app) {
if (app) {
if (app.manifest.version != appManifest.version) {
// Needs an update
navigator.mozApps.install(MANIFEST);
}
} else {
// Might want to ask user to install app
}
});
};
req.send();
On Jan 5, 12:47 pm, Ian Bicking <
i...@colorstudy.com> wrote:
> On Thu, Jan 5, 2012 at 8:59 AM, gmgj <
gary.johnson...@gmail.com> wrote:
> > Thanks for the reply.
>
> > If I change my webapp file at
> >
http://garyjohnsoninfo.info//XXSoftwareTools/MEvaluator-CalculatorApp...
> > This pagehttps://
developer.mozilla.org/en/Apps/Manifestis now