mozilla

Revision 59324 of Manifest

  • Revision slug: Talk:Apps/Manifest
  • Revision title: Manifest
  • Revision id: 59324
  • Created:
  • Creator: Gary.johnson.53
  • Is current revision? No
  • Comment Example paths and update questions; 696 words added, 24 words removed

Revision Content

Using the https://apps-preview.mozilla.org/en-US/apps/  store as the point for users to start downloading your app.
The store maintains a link to your manifest location.  

URL to my app files

http://garyjohnsoninfo.info//XXSoftw...atorApp.webapp
http://garyjohnsoninfo.info//XXSoftw...ulatorApp.html   // the web app
http://garyjohnsoninfo.info//XXSoftw...lator16x16.png
...

the webapp file

{
The document is expected to be UTF-8, but another encoding can be specified with a charset parameter on the Content-Type header (i.e. Content-Type: application/x-web-app-manifest+json; charset=ISO-8859-4).
Use UTF-no BOM until bug https://bugzilla.mozilla.org/show_bug.cgi?id=711538 is fixed and in your version fo Firefox (Beta, nightly, release, android)

Apache users
add the following line to a copy of the approprate .htacess file
AddType application/x-web-app-manifest+json .webapp

Delete the old .htaccess - don't overwrite.
Upload new .htaccess in ascii mode and chmod 777
}

{

manifest paths start from the domain name

  "launch_path": "/XXSoftwareTools/MEvaluator-CalculatorApp.html",
  "icons": {
    "16": "/XXSoftwareTools/images/Calculator16x16.png",
    "48": "/XXSoftwareTools/images/Calculator48x48.png",
...
}


To update your files, upload them to your server.  
new users will automatically get the new files

Existing users of your apps can delete the app and reinstall to get the changes
If you change the locations of your manifest or launch_path, this might be the safest thing to do?


Or you add an update function to the app to check for changes to the

Manifest
HTML file
other included files


If you are using the HTML5 chache, what do you do to keep the store in sych?


HTML5 chache
<html manifest="MEvaluator-CalculatorApp.appcache">
http://dev.w3.org/html5/spec/offline.html

...
When the user visits a page that declares a manifest, the browser will try to update the cache.
It does this by fetching a copy of the manifest and, if the manifest has changed since the user agent last saw it,
redownloading all the resources it mentions and caching them anew.


If you are not using the HTML 5 chache, what do they do


Sample Code to check to check for an update to a webapp file.
Note: flesh out version checking, != could work but, it does depend on change history etc.

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();



HTML 5
AddType text/cache-manifest .appcache .manifest


The important differentiation in my mind is "hosted" vs. "packaged" apps.
W3C Widgets are for "packaged" apps where the resources are packaged in a
zip file and downloaded, Mozilla's Open Web Apps and Chrome's hosted apps
are "hosted" web apps where each of the resources are hosted on a web
server (though can be cached locally using HTML5 APIs)

Revision Source

<p>Using the <a class=" link-https" href="https://apps-preview.mozilla.org/en-US/apps/" rel="freelink">https://apps-preview.mozilla.org/en-US/apps/</a>  store as the point for users to start downloading your app.<br> The store maintains a link to your manifest location.  <br> <br> URL to my app files<br> <br> <a class=" external" href="http://garyjohnsoninfo.info//XXSoftwareTools/MEvaluator-CalculatorApp.webapp" rel="freelink">http://garyjohnsoninfo.info//XXSoftw...atorApp.webapp</a><br> <a class=" external" href="http://garyjohnsoninfo.info//XXSoftwareTools/MEvaluator-CalculatorApp.html" rel="freelink">http://garyjohnsoninfo.info//XXSoftw...ulatorApp.html</a>   // the web app<br> <a class=" external" href="http://garyjohnsoninfo.info//XXSoftwareTools/images/Calculator16x16.png" rel="freelink">http://garyjohnsoninfo.info//XXSoftw...lator16x16.png</a><br> ...<br> <br> the webapp file<br> <br> {<br> The document is expected to be UTF-8, but another encoding can be specified with a charset parameter on the Content-Type header (i.e. Content-Type: application/x-web-app-manifest+json; charset=ISO-8859-4).<br> Use UTF-no BOM until bug <a class=" link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=711538" rel="freelink">https://bugzilla.mozilla.org/show_bug.cgi?id=711538</a> is fixed and in your version fo Firefox (Beta, nightly, release, android)<br> <br> Apache users<br> add the following line to a copy of the approprate .htacess file<br> AddType application/x-web-app-manifest+json .webapp<br> <br> Delete the old .htaccess - don't overwrite.<br> Upload new .htaccess in ascii mode and chmod 777<br> }<br> <br> {<br> <br> manifest paths start from the domain name<br> <br>   "launch_path": "/XXSoftwareTools/MEvaluator-CalculatorApp.html",<br>   "icons": {<br>     "16": "/XXSoftwareTools/images/Calculator16x16.png",<br>     "48": "/XXSoftwareTools/images/Calculator48x48.png",<br> ...<br> }<br> <br> <br> To update your files, upload them to your server.  <br> new users will automatically get the new files<br> <br> Existing users of your apps can delete the app and reinstall to get the changes<br> If you change the locations of your manifest or launch_path, this might be the safest thing to do?<br> <br> <br> Or you add an update function to the app to check for changes to the<br> <br> Manifest<br> HTML file<br> other included files<br> <br> <br> If you are using the HTML5 chache, what do you do to keep the store in sych?<br> <br> <br> HTML5 chache<br> &lt;html manifest="MEvaluator-CalculatorApp.appcache"&gt;<br> <a class=" external" href="http://dev.w3.org/html5/spec/offline.html" rel="freelink">http://dev.w3.org/html5/spec/offline.html</a><br> <br> ...<br> When the user visits a page that declares a manifest, the browser will try to update the cache.<br> It does this by fetching a copy of the manifest and, if the manifest has changed since the user agent last saw it,<br> redownloading all the resources it mentions and caching them anew.<br> <br> <br> If you are not using the HTML 5 chache, what do they do<br> <br> <br> Sample Code to check to check for an update to a webapp file.<br> Note: flesh out version checking, != could work but, it does depend on change history etc.<br> <br> var MANIFEST = '/XXSoftwareTools/Mvaluator-CalculatorApp.webapp';<br> <br> req = new XMLHttpRequest();<br> req.open('GET', MANIFEST);<br> req.onreadystatechange = function () {<br>   if (req.readyState != 4) {<br>     return;<br>   }<br>   var appManifest = JSON.parse(req.responseText);<br> <br>   navigator.mozApps.amInstalled(function (app) {<br>     if (app) {<br>       if (app.manifest.version != appManifest.version) {<br>         // Needs an update<br>         navigator.mozApps.install(MANIFEST);<br>       }<br>     } else {<br>       // Might want to ask user to install app<br>     }<br>   });<br> };<br> <br> req.send();<br> <br> <br> <br> HTML 5<br> AddType text/cache-manifest .appcache .manifest<br> <br> <br> The important differentiation in my mind is "hosted" vs. "packaged" apps.<br> W3C Widgets are for "packaged" apps where the resources are packaged in a<br> zip file and downloaded, Mozilla's Open Web Apps and Chrome's hosted apps<br> are "hosted" web apps where each of the resources are hosted on a web<br> server (though can be cached locally using HTML5 APIs)</p>
Revert to this revision