Luca Greco <luca.greco@alcacoop.it> - http://github.com/rpl
{
"name": "MyAppName",
"version": "1.7",
"launch_path": "/index.html"
"description": "...",
"developer": {
"name": "...",
"url": "..."
},
"locales": {
"en-US": {
"name": "...",
"description": "...",
},
},
"default_locale": "en-US",
"icons": {
"128": "/style/icons/Blank.png"
}
}
Content-Type: application/x-web-app-manifest+json
import SimpleHTTPServer
import SocketServer
SimpleHTTPServer.SimpleHTTPRequestHandler. \
extensions_map['.webapp'] = \
'application/x-web-app-manifest+json'
httpd = SocketServer.TCPServer(("", 3000), \
SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.serve_forever()
...
"type": "privileged",
"permissions": {
"contacts": {
"description": "Required for ...",
"access": "readcreate"
},
"alarms": {
"description": "Required to ..."
}
}
...
$ git clone https://github.com/mozilla-b2g/gaia.git
...
$ cd gaia
gaia$ make DEBUG=1
...
gaia$ cp -rf test_apps/template test_apps/mypackagedapp
gaia$ edit test_apps/mypackagedapp/manifest.webapp
gaia$ firefox -no-remote -profile ./profile
...
https://developer.mozilla.org/en/docs/HTML/Using_the_application_cacheCACHE MANIFEST
# v1 2011-08-14
CACHE:
index.html
cache.html
style.css
image1.png
# Use from network if available
NETWORK:
network.html
# Fallback content
FALLBACK:
/ fallback.html
ExpiresByType text/cache-manifest "access plus 0 seconds"
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
{
...
"appcache_path": "/manifest.appcache",
...
}
http://name.domain/folder1
http://name.domain/folder2
var pick = new MozActivity({
name: "pick",
data: {
type: ["image/png", "image/jpg", "image/jpeg"]
}
});
pick.onsuccess = function () {
var img = document.createElement("img");
img.src = window.URL.createObjectURL(this.result.blob);
var viewer = document.querySelector("#image-viewer");
viewer.appendChild(img);
};
pick.onerror = function () {
...
};
if (typeof MozActivity == "function") {
...
} else {
console.log("FALLBACK: call WebActivity 'pick image'");
return;
}
...
"activities": {
"pick": {
"filters": {
"type": ["image/*", "image/jpeg", "image/png"]
},
"disposition": "inline",
"returnValue": true,
"href": "/index.html#pick"
},
...
},
...