Max Boll
Don't follow me, I run into walls. Passionate Frontend & Backend Web-Developer.
{
"name": "Blip",
"description": "Blip is a simple whack-a-mole game.",
"launch_path": "/",
"icons": {
"128": "/img/icon-128.png"
},
"developer": {
"name": "Max Boll",
"url": "http://myxotod.com"
},
"default_locale": "en"
}
<html manifest="offline.appcache">
CACHE MANIFEST
/assets/stylesheets/application.css
/assets/javascripts/application.js
/assets/images/picture-of-a-really-cool-cat.jpg
manifest: "http://domain.tld/manifest.webapp",
is_installed: function() {
var request = navigator.mozApps.checkInstalled(this.manifest);
request.onsuccess = function() {
if (request.result) {
return true;
} else {
return false;
}
};
request.onerror = function() {
console.log(this.error.message);
return false;
};
}, ...
manifest: "http://domain.tld/manifest.webapp",
install: function() {
var request = navigator.mozApps.install(this.manifest);
request.onsuccess = function() {
return true;
};
request.onerror = function() {
console.log(this.error.name);
return false;
};
}, ...
vibrate: function(ms) {
if ('vibrate' in navigator) {
navigator.vibrate(ms); // vibrate for X ms
}
}, ...
/app <-- Contains your app
/index.html <-- The landing page
/manifest.webapp <-- Your app manifest
{
"name": "Blip",
"description": "Blip is a simple whack-a-mole game.",
"launch_path": "/app",
"icons": {
"128": "/img/icon-128.png"
}, ...
}
By Max Boll