-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboot.js
More file actions
42 lines (37 loc) · 1.34 KB
/
Copy pathboot.js
File metadata and controls
42 lines (37 loc) · 1.34 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
(function () {
const isFileProtocol = window.location.protocol === "file:";
function loadScript(src, isModule) {
return new Promise((resolve, reject) => {
const script = document.createElement("script");
if (isModule) {
script.type = "module";
}
script.src = src;
script.onload = () => resolve();
script.onerror = () => reject(new Error(`Failed to load ${src}`));
document.body.appendChild(script);
});
}
if (!isFileProtocol) {
const manifest = document.createElement("link");
manifest.rel = "manifest";
manifest.href = "./manifest.webmanifest";
document.head.appendChild(manifest);
loadScript("./vendor/plyr/plyr.min.js?v=1", false)
.catch(() => {
// App will still run without Plyr; custom controls remain available.
})
.finally(() => loadScript("./app.js?v=20260425b", true));
return;
}
const banner = document.getElementById("modeBanner");
if (banner) {
banner.classList.remove("hidden");
banner.textContent = "File mode detected: PWA features are reduced. Core playback, playlist, and settings remain available.";
}
loadScript("./vendor/plyr/plyr.min.js?v=1", false)
.catch(() => {
// App will still run without Plyr in file mode fallback.
})
.finally(() => loadScript("./app.js?v=20260425b", false));
})();