-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.html
32 lines (26 loc) · 922 Bytes
/
install.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<meta charset="UTF-8">
<head>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<title>app install</title>
</head>
<body>
<script>
function onsuccess() {
console.log( "app installed" );
this.launch();
}
function onerror(error) {
/*global console: false */
console.log("app install failed: " + error.message +
"(" + error.code + ")");
}
// Get the current path, without the file name
var path = document.URL.split( '/' ).slice( 0, -1 ).join( '/' );
var request = navigator.mozApps.install(path + "/manifest.webapp");
request.onsuccess = onsuccess.bind( request );
request.onerror = onerror;
</script>
</body>
</html>