-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
77 lines (75 loc) · 2.75 KB
/
index.html
File metadata and controls
77 lines (75 loc) · 2.75 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Qontinui Runner</title>
<style>
/* Fallback styles to ensure visibility */
body {
margin: 0;
padding: 0;
background-color: #0a0a0b;
color: white;
font-family:
system-ui,
-apple-system,
sans-serif;
min-height: 100vh;
}
#root {
min-height: 100vh;
}
/* Loading indicator */
#root:empty::after {
content: "Loading Qontinui Runner...";
display: block;
padding: 20px;
text-align: center;
color: #00d9ff;
}
</style>
<script>
// Catch errors during main bundle execution (IIFE runs synchronously).
// Must be in <head> BEFORE the main script so it's installed in time.
window.__BOOT_ERRORS = [];
window.onerror = function (msg, src, line, col, err) {
window.__BOOT_ERRORS.push({ msg: String(msg), src: String(src), line: line, col: col, stack: err && err.stack ? err.stack.substring(0, 500) : null });
var root = document.getElementById("root");
if (root && root.childElementCount === 0) {
root.innerHTML = '<pre style="color:#ff6b6b;padding:20px;white-space:pre-wrap">Boot error: ' + msg + '\nat ' + src + ':' + line + ':' + col + (err && err.stack ? '\n\n' + err.stack.substring(0, 1000) : '') + '</pre>';
}
};
window.addEventListener("unhandledrejection", function (e) {
window.__BOOT_ERRORS.push({ type: "unhandledrejection", reason: String(e.reason).substring(0, 500) });
});
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script>
// Auto-reload if React fails to mount (e.g., webview loads before assets are ready).
// Only retry once to avoid infinite reload loops.
(function () {
var key = "__qontinui_boot_retry";
var alreadyRetried = sessionStorage.getItem(key);
setTimeout(function () {
var root = document.getElementById("root");
if (root && root.childElementCount === 0) {
if (!alreadyRetried) {
console.warn("[BOOT] React did not mount within 4s — reloading page");
sessionStorage.setItem(key, "1");
window.location.reload();
} else {
console.error("[BOOT] React failed to mount after retry — check console for errors");
}
} else {
// Mounted successfully — clear the retry flag for next cold start
sessionStorage.removeItem(key);
}
}, 4000);
})();
</script>
</body>
</html>