-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
33 lines (29 loc) · 1.55 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon">
<meta name="apple-mobile-web-app-status-bar" content="#212529" />
<meta name="theme-color" content="#0d6efd" />
<title>Redownload Files</title>
</head>
<body style="padding: 20px;" data-bs-theme="dark">
<div id="root"></div><br><br>
<i>Version <span id="version">1.0.0</span></i>
<script type="module" src="/src/main.tsx"></script>
<script src="./zip-stream.js"></script>
<script>
if ('serviceWorker' in navigator) {
const registerServiceWorker = async () => {
window.sw = await navigator.serviceWorker.register('./service-worker.js');
};
registerServiceWorker();
} else console.error(":/")
if (localStorage.getItem("RedownloadFiles-Theme") === "a") document.body.setAttribute("data-bs-theme", "light");
let appVersion = "1.0.3";
document.getElementById("version").textContent = appVersion;
fetch("./updatecode.txt", { cache: "no-store" }).then((res) => res.text().then((text) => { if (text.replace("\n", "") !== appVersion) if (confirm(`There's a new version of redownload-files. Do you want to update? [${appVersion} --> ${text.replace("\n", "")}]`)) { caches.delete("redownloadfiles-cache"); location.reload(true); } }).catch((e) => { console.error(e) })).catch((e) => console.error(e)); // Check if the application code is the same as the current application version and, if not, ask the user to update
</script>
</body>
</html>