Files

61 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Monitor de Cookies</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; }
table { width: 80%; margin: 20px auto; border-collapse: collapse; }
th, td { border: 1px solid black; padding: 10px; text-align: left; }
th { background-color: #f2f2f2; }
</style>
</head>
<body>
<h1>Cookies en tiempo real</h1>
<table>
<thead>
<tr>
<th>Dominio</th>
<th>Nombre</th>
<th>Valor</th>
</tr>
</thead>
<tbody id="cookiesTable">
<tr><td colspan="3">Cargando cookies...</td></tr>
</tbody>
</table>
<script>
async function loadCookies() {
try {
const response = await fetch("cookies.json?_=" + new Date().getTime()); // Forzar recarga evitando caché
if (!response.ok) throw new Error("Error al cargar cookies.json");
const cookies = await response.json();
const tableBody = document.getElementById("cookiesTable");
tableBody.innerHTML = ""; // Limpiar la tabla
cookies.forEach(cookie => {
const row = `<tr>
<td>${cookie.domain}</td>
<td>${cookie.name}</td>
<td>${cookie.value}</td>
</tr>`;
tableBody.innerHTML += row;
});
} catch (error) {
console.error("Error cargando cookies:", error);
document.getElementById("cookiesTable").innerHTML = "<tr><td colspan='3'>Error al cargar cookies</td></tr>";
}
}
setInterval(loadCookies, 5000);
loadCookies();
</script>
</body>
</html>