-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
42 lines (42 loc) · 1.05 KB
/
Copy pathindex.html
File metadata and controls
42 lines (42 loc) · 1.05 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
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<html
lang="en"
style="
background: #000;
margin: 0px;
height: 100%;
width: 100%;
font-family: 'Open Sans', sans-serif;
"
>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RunWebBox</title>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
const swPath = location.host.includes('localhost')
? '/RunWebBox/sw.js'
: '/sw.js';
navigator.serviceWorker
.register(swPath, {
scope: '/',
})
.then(
function (registration) {
console.log('ServiceWorker registration successful');
},
function (err) {
console.log('ServiceWorker registration failed: ', err);
}
);
});
}
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>