"Mobile & Embedded" @ GDG Firenze - 13 Febbraio 2014
Created by Luca Greco
{
"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"
}
}
Packaged App:
all standard and experimental WebAPIs +
extended priviliged WebAPIs available
Priviliged and Certified Packaged App:
enforce a CSP (content security policy) by default:
...
"type": "privileged",
"permissions": {
"contacts": {
"description": "Required for ...",
"access": "readcreate"
},
"alarms": {
"description": "Required to ..."
}
}
...
if (typeof MozActivity == "function") {
...
} else {
console.log("FALLBACK: call WebActivity" +
" 'pick image'");
return;
}
var pick = new MozActivity({
name: "pick",
data: {
type: ["image/png",
"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 () { ... };
...
"activities": {
"pick": {
"filters": {
"type": ["image/*", "image/jpeg"]
},
"disposition": "inline",
"returnValue": true,
"href": "/index.html#pick"
},
...