Skip to content

Instantly share code, notes, and snippets.

@qq99
Created August 6, 2015 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qq99/a58995f43db778df38c0 to your computer and use it in GitHub Desktop.
Save qq99/a58995f43db778df38c0 to your computer and use it in GitHub Desktop.
Example of simple HTML file to install a fxos app
<!DOCTYPE html>
<head>
<script>
function installApplication () {
var manifestLocation = window.location.protocol + "//" + window.location.host + "/manifest.webapp";
console.log("Attempting to install from", manifestLocation);
var installApp = navigator.mozApps.install(manifestLocation);
// Successful install
installApp.onsuccess = function(data) {
console.log("Success, app installed!");
};
// Install failed
installApp.onerror = function() {
console.log("Install failed\n\n:" + installApp.error.name);
};
}
</script>
</head>
<body>
<button onclick="installApplication()">Install</button>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment