This repository was archived by the owner on Aug 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path404.html
More file actions
101 lines (98 loc) · 3.93 KB
/
Copy path404.html
File metadata and controls
101 lines (98 loc) · 3.93 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Save Money - Gerencie seus investimentos e economize de forma inteligente." />
<meta name="keywords" content="economia, investimentos, finanças, gerenciamento financeiro, Save Money" />
<meta name="author" content="Equipe Save Money - PUC Minas Tecnologia" />
<meta name="robots" content="index, follow" />
<link rel="icon" type="image/png" href="./codigo-fonte/assets/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="./codigo-fonte/assets/favicon.svg" />
<link rel="shortcut icon" href="./codigo-fonte/assets/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="./codigo-fonte/assets/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="Save Money" />
<link rel="manifest" href="./codigo-fonte/assets/site.webmanifest" />
<base href="/">
<title>Save Money</title>
<link rel="stylesheet" href="./codigo-fonte/styles/reset.css" />
<link rel="stylesheet" href="./codigo-fonte/styles/global.css" />
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet" />
<script type="module" src="./codigo-fonte/core/index.js" nonce="YWJjMTIzNDU2Nzg5"></script>
<script type="text/javascript">
// Verifica se a rota existe
const path = window.location.pathname;
const validRoutes = [
// Rotas públicas
'/',
'/login',
'/registration',
'/esqueceu',
'/reset-password',
'/sobre',
'/contato',
'/404',
// Rotas protegidas
'/perfil',
'/user-edit',
'/investimentos',
'/recrutamento',
'/receitas',
'/despesas',
'/conversor-moedas',
'/categorias',
'/lembretes-contas',
'/codigo-fonte/lembretes-contas/index.html',
'/metas-financeiras',
'/codigo-fonte/metas-financeiras/index.html',
'/relatorios',
'/codigo-fonte/relatorios/relatorios.html',
'/testes'
];
if (!validRoutes.includes(path)) {
history.pushState(null, '', '/404');
window.dispatchEvent(new PopStateEvent('popstate'));
} else if (path === '/404') {
// Se já estiver na página 404, não faz nada
} else {
history.pushState(null, '', path);
window.dispatchEvent(new PopStateEvent('popstate'));
}
</script>
<!-- <meta
http-equiv="Content-Security-Policy"
content="
default-src 'self';
script-src 'self' https://save-money-puc.web.app/ 'strict-dynamic' 'nonce-YWJjMTIzNDU2Nzg5';
style-src 'self' https://fonts.googleapis.com/ 'unsafe-inline';
font-src 'self' https://fonts.gstatic.com/;
img-src 'self' data: https://save-money-puc.web.app/;
connect-src 'self' https://save-money-puc.web.app/ https://fonts.googleapis.com/ https://fonts.gstatic.com/;
manifest-src 'self';
object-src 'none';
base-uri 'self';
"
/> -->
</head>
<body>
<save-money-core></save-money-core>
<script type="module" nonce="YWJjMTIzNDU2Nzg5">
// Registrar o Service Worker
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swPath = `./codigo-fonte/service-worker.js`;
navigator.serviceWorker
.register(swPath, {
type: 'module'
})
.then((registration) => {
console.log('Service Worker registrado com sucesso:', registration.scope);
})
.catch((error) => {
console.error('Falha ao registrar o Service Worker:', error);
});
});
}
</script>
</body>
</html>