-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
61 lines (59 loc) · 2.12 KB
/
Copy pathindex.html
File metadata and controls
61 lines (59 loc) · 2.12 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
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>FinanAssistant AI</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script>
if (typeof global === 'undefined') {
window.global = window;
}
if (typeof process === 'undefined') {
window.process = { env: {} };
}
// Global Error Handler for LocalStorage Corruption & JSON.parse safety
(function() {
const originalParse = JSON.parse;
JSON.parse = function(text, reviver) {
if (text === "undefined" || text === undefined || text === "null" || text === null) return null;
if (typeof text === 'string') {
const trimmed = text.trim();
if (trimmed === "" || trimmed === "undefined" || trimmed === "null" || trimmed === "[object Object]") {
return null;
}
}
try {
return originalParse(text, reviver);
} catch (e) {
if (e instanceof SyntaxError) {
const textStr = String(text);
if (textStr.includes('undefined') || textStr.includes('[object Object]') || textStr.length < 2) {
return null;
}
}
throw e;
}
};
})();
// Prevent libraries from overwriting fetch if it's already a getter
const originalFetch = window.fetch;
try {
Object.defineProperty(window, 'fetch', {
configurable: true,
enumerable: true,
get: () => originalFetch,
set: (v) => { console.warn('Library tried to overwrite fetch', v); }
});
} catch (e) {
console.error('Could not protect fetch', e);
}
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>