<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<noscript><meta http-equiv="refresh" content="3;url=/" /></noscript>
<title>Connecting to Freenet</title>
<link rel="icon" href="https://freenet.org/favicon.ico" />
<style>
body {
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
background: #f5f5f5;
}
.container {
text-align: center;
padding: 2rem;
}
.logo {
width: 80px;
height: 80px;
margin-bottom: 1.5rem;
}
h1 {
color: #333;
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
p {
color: #666;
line-height: 1.5;
}
a {
color: #1976d2;
}
</style>
</head>
<body>
<div class="container">
<img
src="https://freenet.org/freenet_logo.svg"
alt="Freenet"
class="logo"
/>
<h1 id="title">Connecting to Freenet...</h1>
<p id="msg">
Your peer is reconnecting. This page will refresh automatically.
</p>
</div>
<script>
function connectingRecoveryDecision(search, atTop, now) {
var RECOVERY_MAX_MS = 120000; var m = /[?&]_freload=([^&]*)/.exec(search || '');
var recoveryStart = null;
if (m) {
var val = decodeURIComponent(m[1]);
var dash = val.indexOf('-');
var ts = parseInt(dash >= 0 ? val.slice(0, dash) : val, 10);
if (isFinite(ts)) recoveryStart = ts;
}
if (recoveryStart === null) {
return atTop ? { action: 'dashboard' } : { action: 'stamp' };
}
var elapsed = now - recoveryStart;
if (elapsed >= 0 && elapsed < RECOVERY_MAX_MS) {
return { action: 'retry' };
}
return atTop ? { action: 'dashboard' } : { action: 'giveup' };
}
setTimeout(function () {
var atTop;
try {
atTop = window.top === window.self;
} catch (e) {
atTop = false;
}
var d = connectingRecoveryDecision(location.search, atTop, Date.now());
if (d.action === 'dashboard') {
window.location.replace('/');
} else if (d.action === 'retry') {
window.location.reload();
} else if (d.action === 'stamp') {
try {
var u = new URL(location.href);
u.searchParams.set('_freload', String(Date.now()) + '-0');
window.location.replace(u.toString());
} catch (e) {
window.location.reload();
}
} else {
var title = document.getElementById('title');
var msg = document.getElementById('msg');
if (title) title.textContent = 'Still connecting…';
if (msg) {
msg.textContent =
'Your peer is taking longer than usual to reconnect. Please reload this tab to try again.';
}
}
}, 3000);
</script>
</body>
</html>