// Hero Proof
function detectBrowserOS() {
const ua = navigator.userAgent;
let browser = "Unknown", os = "Unknown";
if (/firefox/i.test(ua)) browser = "Firefox";
else if (/edg/i.test(ua)) browser = "Edge";
else if (/chrome|crios/i.test(ua) && !/edg/i.test(ua)) browser = "Chrome";
else if (/safari/i.test(ua) && !/chrome|crios|edg/i.test(ua)) browser = "Safari";
if (/windows nt 11/i.test(ua)) os = "Windows 11";
else if (/windows nt 10/i.test(ua)) os = "Windows 10";
else if (/mac os x/i.test(ua)) os = "macOS";
else if (/android/i.test(ua)) os = "Android";
else if (/iphone|ipad|ipod/i.test(ua)) os = "iOS";
else if (/linux/i.test(ua)) os = "Linux";
const resolution = `${window.screen.width}×${window.screen.height}`;
return { browser, os, resolution };
}
function maskIp(ip) {
// IPv4 93.104.15.201 -> 93.104.15.x | IPv6: kürzen
if (ip.includes(".")) {
const parts = ip.split(".");
parts[3] = "x";
return parts.join(".");
}
return ip.split(":").slice(0, 4).join(":") + ":…";
}
async function setHeroProof() {
const heroEl = document.getElementById('hero-proof');
try {
const res = await fetch('/geoip.php');
if (!res.ok) throw new Error('API error');
const data = await res.json();
const { browser, os, resolution } = detectBrowserOS();
const city = data.city || "your city";
const country = data.country_name || "your country";
const ipMasked = data.ip ? maskIp(data.ip) : "—";
heroEl.innerHTML = `
You are currently located approximately in ${city}, ${country}
(IP: ${data.ip}).
You are using the browser ${browser} under ${os}.
Even your screen resolution of ${resolution} pixels is visible to us.
`;
} catch {
const { browser, os, resolution } = detectBrowserOS();
heroEl.innerHTML = `
We couldn't load your location just now.
Your browser: ${browser} under
${os}, resolution
${resolution} pixels.
`;
}
}
// ==== IP & Location ====
async function fetchIPInfo() {
const resultEl = document.getElementById('ip-result');
try {
const res = await fetch('/geoip.php');
if (!res.ok) throw new Error('API error');
const data = await res.json();
// const hint = `Note: This location display is based on your IP address and is usually only accurate to within a few kilometres.
// With GPS-enabled devices and location sharing, it may be accurate to within a few metres.`;
resultEl.innerHTML = `
IP: ${data.ip}
Country: ${data.country_name} (${data.country})
Region: ${data.region || '—'}
City: ${data.city || '—'}
${data.org ? `ISP: ${data.org}
` : ''}Coordinates: ${data.latitude}, ${data.longitude}
`; renderIpMap(data.latitude, data.longitude, data.city); } catch (err) { resultEl.innerHTML = `Error: ${err.message}`; } } // RENDER IP MAP let ipMap; function renderIpMap(lat, lon, label) { const el = document.getElementById('ip-map'); if (!el || lat == null || lon == null) return; const latNum = Number(lat), lonNum = Number(lon); if (!isFinite(latNum) || !isFinite(lonNum)) return; if (!window.L) return; // Leaflet noch nicht geladen const center = [latNum, lonNum]; if (ipMap) { ipMap.setView(center, 10); if (ipMap._marker) { ipMap._marker.setLatLng(center).setPopupContent(label || "Approximately here"); } else { ipMap._marker = L.marker(center).addTo(ipMap).bindPopup(label || "Approximately here"); } return; } ipMap = L.map('ip-map', { zoomControl: false, attributionControl: true }).setView(center, 8); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '© OpenStreetMap-Mitwirkende' }).addTo(ipMap); ipMap._marker = L.marker(center).addTo(ipMap).bindPopup(label || "Approximately here"); } // ==== Fingerprint ==== function generateFingerprint() { const fpEl = document.getElementById('fp-result'); const fingerprintData = [ { label: 'Browser', value: navigator.userAgent }, { label: 'Language', value: navigator.language }, { label: 'Operating System', value: navigator.platform }, { label: 'Screen', value: `${window.screen.width}×${window.screen.height} (DPR ${window.devicePixelRatio})` }, { label: 'Timezone', value: Intl.DateTimeFormat().resolvedOptions().timeZone }, { label: 'Cookies enabled?', value: navigator.cookieEnabled ? 'Ja' : 'Nein' }, { label: 'Do Not Track', value: navigator.doNotTrack === '1' ? 'Enabled' : 'Disabled' } ]; // Canvas Fingerprint (vereinfachtes Beispiel) const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); ctx.textBaseline = 'top'; ctx.font = "14px 'Arial'"; ctx.textBaseline = 'alphabetic'; ctx.fillStyle = '#f60'; ctx.fillRect(125,1,62,20); ctx.fillStyle = '#069'; ctx.fillText('privacy-check', 2, 15); ctx.fillStyle = 'rgba(102, 204, 0, 0.7)'; ctx.fillText('privacy-check', 4, 17); const canvasHash = hashCode(canvas.toDataURL()); fingerprintData.push({ label: 'Canvas Fingerprint', value: `${canvasHash} (Unique device identifier)` }); // Anzeige als Liste fpEl.innerHTML = `🔍 Tracker domains found:
| Type | Domain | Owner | Category | Details |
|---|---|---|---|---|
| ${t.type} | ${t.domain} | ${owner} | ${categories} |
Full link:
${t.src}
|