The error is just a plain json error message, no line number no
nothing. But as it turns out, I saved the file as UTF no BOM and it
was accepted. Thanks for replying
On Jan 4, 8:28 am, JoeStagner <joestag...@gmail.com> wrote:
On Tue, Jan 3, 2012 at 2:25 PM, gmgj <gary.johnson...@gmail.com> wrote: > I see this in the doc:
> The manifest and app origin (protocol, host name, and port number) are > collectively the complete description of an installed app
> 1) but I don't know what the app origin is?
The origin is basically the site your app (and its manifest) are on. In your case "http://garyjohnsoninfo.info" - so all the URLs are calculated with the origin plus whatever value (e.g., the icon).
> 2) I am unsure of what the launch_path entry could or should be
It's the page that will open up when a user clicks on the icon. If you want it to open http://garyjohnsoninfo.info/ then it can be "/" (or just leave it out, that's the default). But if you do launch_path: "/start.html" then when the user clicks on your icon they'll go to http://garyjohnsoninfo.info/start.html
> 3) why does it fail?
Seems you figured it out, probably the BOM - we have a fix for this, but I guess it hasn't been deployed yet.
by adding a "launch_path": "/XXSoftwareTools/MEvaluator-
CalculatorApp.html", line; would existing users pick up the change
and be directed to the new
launch_path?
1)
I have done that and it does not appear to work. Is their something
else I have to do?
2)
This page https://developer.mozilla.org/en/Apps/Manifest is now
showing this error
"reference to undefined name 'syntax' Exception of type
'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was
thrown. (click for details)."
3)
In the future, would you consider adding more examples to the existing
documentation (see prior post) and just reply, see the updated doc at
xxxx?
I would even consider highlighting things like "as of Jan 5 2012" if
you use UTF-8 you need to submit webapp's as UTF-8 -NO BOM
> by adding a "launch_path": "/XXSoftwareTools/MEvaluator- > CalculatorApp.html", line; would existing users pick up the change > and be directed to the new > launch_path?
No, they have to reinstall. Or you can do:
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();
I realize that's a bit long-winded - but it will check if the app is installed, and if installed if the manifest is up to date. (And yes, this code certainly needs to be in the docs, which I'll fix soon!)
> 1) > I have done that and it does not appear to work. Is their something > else I have to do?
> 2) > This page https://developer.mozilla.org/en/Apps/Manifest is now > showing this error > "reference to undefined name 'syntax' Exception of type > 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was > thrown. (click for details)."
Thanks for the note, I've opened a bug on that. Something on the server must have changed recently to break that.
> 3) > In the future, would you consider adding more examples to the existing > documentation (see prior post) and just reply, see the updated doc at > xxxx? > I would even consider highlighting things like "as of Jan 5 2012" if > you use UTF-8 you need to submit webapp's as UTF-8 -NO BOM
Yes, you are right - though with all the broken examples I'm hoping to get that fixed so I don't mess up existing content.
> On Thu, Jan 5, 2012 at 8:59 AM, gmgj <gary.johnson...@gmail.com > <mailto:gary.johnson...@gmail.com>> wrote:
> 2) > This page https://developer.mozilla.org/en/Apps/Manifest is now > showing this error > "reference to undefined name 'syntax' Exception of type > 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was > thrown. (click for details)."
> Thanks for the note, I've opened a bug on that. Something on the > server must have changed recently to break that.
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:
> > by adding a "launch_path": "/XXSoftwareTools/MEvaluator-
> > CalculatorApp.html", line; would existing users pick up the change
> > and be directed to the new
> > launch_path?
> No, they have to reinstall. Or you can do:
> 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();
> I realize that's a bit long-winded - but it will check if the app is
> installed, and if installed if the manifest is up to date. (And yes, this
> code certainly needs to be in the docs, which I'll fix soon!)
> > 1)
> > I have done that and it does not appear to work. Is their something
> > else I have to do?
> > 2)
> > This pagehttps://developer.mozilla.org/en/Apps/Manifestis now
> > showing this error
> > "reference to undefined name 'syntax' Exception of type
> > 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was
> > thrown. (click for details)."
> Thanks for the note, I've opened a bug on that. Something on the server
> must have changed recently to break that.
> > 3)
> > In the future, would you consider adding more examples to the existing
> > documentation (see prior post) and just reply, see the updated doc at
> > xxxx?
> > I would even consider highlighting things like "as of Jan 5 2012" if
> > you use UTF-8 you need to submit webapp's as UTF-8 -NO BOM
> Yes, you are right - though with all the broken examples I'm hoping to get
> that fixed so I don't mess up existing content.
On Sat, Jan 14, 2012 at 11:20 AM, gmgj <gary.johnson...@gmail.com> wrote: > 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.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.
If you are using appcache, then the origin doesn't actually change; it doesn't appear, for instance, that you are requesting a resource a local file. Or are you thinking about actually saving the files locally, like with "Save As"?
> 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.
I think, in part in response to this input, that we'll be handling app manifest updates (not to be confused with app CACHE manifest updates ;) more automatically, and not requiring manual checks. I think that will mean polling the server on a regular interval, but using HTTP cache semantics (i.e., if you set Expires then it won't poll until after the resource is expired). In cases when you want to force an update then probably a call to .install() will be necessary. But this XMLHttpRequest polling shouldn't be necessary.
We're getting ready to do a revision of the API, and there should be more details then.