-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
32 lines (31 loc) · 1.13 KB
/
Copy pathindex.html
File metadata and controls
32 lines (31 loc) · 1.13 KB
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>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PWA Template</title>
<link rel="stylesheet" href="./styles.css">
<link rel="manifest" href="./manifest.json">
<link rel="icon" type="image/png" href="./images/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="./images/favicon-16x16.png" sizes="16x16">
</head>
<body>
<h1>Hello, PWA!</h1>
<p>This is a simple PWA template.</p>
<script src="./app.js"></script>
<script>
// Register the Service Worker
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('./service-worker.js')
.then(registration => {
console.log('Service Worker registered! 😎');
})
.catch(err => {
console.log('Service Worker registration failed: 😥', err);
});
});
}
</script>
</body>
</html>