-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
37 lines (36 loc) · 1.21 KB
/
index.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
33
34
35
36
37
<html>
<head>
<title>PWA Boilerplate</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<link rel="manifest" href="/manifest.webmanifest">
<script type="text/javascript" src="/index.js"></script>
<link rel="apple-touch-icon" href="/icon192x192.png">
<link rel="apple-touch-startup-image" href="/icon192x192.png">
</head>
<body>
<script>
// make sure that the browser supports Service Workers and register if so.
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/serviceworker.js').then( function(reg) {
// registration successful
console.log('Registration successful.');
console.log('Scope: ', reg.scope);
// NOTE: the following can be used to request persistent storage.
if (navigator.storage && navigator.storage.persist) {
navigator.storage.persist().then(granted => {
if (granted)
console.log("Persistent storage granted");
else
console.log("Persistent storage denied");
});
}
}).catch(function(error) {
// failed
console.log('Registration failed: ', error);
});
}
</script>
testing
</body>
</html>