forked from Qlugat/qlugat.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
90 lines (80 loc) · 2.24 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<title>React App</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<meta name="mobile-wep-app-capable" content="yes" />
<meta name="apple-mobile-wep-app-capable" content="yes" />
<link rel="manifest" href="manifest.json" />
<style>
html,
body {
overscroll-behavior: none;
}
body {
font-family: Helvetica, Arial, sans-serif;
margin: 0;
}
h1,
h2,
h3 {
font-weight: normal;
}
img {
display: block;
max-width: 100%;
}
a {
cursor: pointer;
}
</style>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.addEventListener(
"controllerchange",
(event) => {
location.reload();
}
);
navigator.serviceWorker.register("/sw.js").then(checkForUpdates);
function checkForUpdates(register) {
if (!navigator.serviceWorker.controller) {
return;
}
if (register.waiting) {
if (confirm("Do you want to update?")) {
register.waiting.postMessage({ action: "skipWaiting" });
}
return;
}
if (register.installing) {
register.installing.addEventListener("statechange", (event) => {
if (register.installing.state === "installed") {
if (confirm("Do you want to update?")) {
register.installing.postMessage({
action: "skipWaiting",
});
}
}
});
return;
}
register.addEventListener("updatefound", (event) => {
register.installing.addEventListener("statechange", (event) => {
checkForUpdates(register);
});
});
}
}
</script>
<script src="app-A7GJVIB4.js"></script></body>
</html>