-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
27 lines (26 loc) · 1.65 KB
/
index.html
File metadata and controls
27 lines (26 loc) · 1.65 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="./icon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MusicPlay</title>
<meta name="description" content="A local music player: play all the songs saved on your device, directly from your browser. No upload required.">
<link href="https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<link rel="manifest" href="./manifest.json" />
</head>
<body>
<div id="app"></div>
<script>
if (typeof crypto.randomUUID === "undefined") crypto.randomUUID = () => Math.random().toString();
if (window.location.hash && window.location.hash !== "#restoreTheme") history.replaceState("", "", "./");
window.musicPlayerVersion = "1.0.1";
(async () => {
const result = await navigator.serviceWorker.register('./service-worker.js');
if (navigator.onLine) await result.update();
})();
fetch("./updatecode", { cache: "no-store" }).then((res) => res.text().then((text) => { if (text.replace("\n", "") !== window.musicPlayerVersion) if (confirm(`There's a new version of MusicPlay. Do you want to update? [${window.musicPlayerVersion} --> ${text.replace("\n", "")}]`)) { caches.delete("musicplayer-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>
<script type="module" src="/src/main.ts"></script>
</body>
</html>