
18.04.2025 / index (10)
.htmlИнформация о системе Информация о системе function getSystemInfo() { const info = []; // Получение информации о браузере info.push(`Browser: ${navigator.userAgent}`); // Получение времени const now = new Date(); const formattedTime = now.toLocaleTimeString([], { hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: false }); info.push(`Local Time: ${formattedTime}`); // Получение часового пояса const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; info.push(`Time Zone: ${timezone}`); // Попытка получить IP-адрес (может не работать в OneCompiler) fetch('https://api.ipify.org/?format=json') .then(response => response.json()) .then(data => { info.push(`Public IP Address: ${data.ip}`); document.getElementById('system-info').innerText = info.join('\n'); }) .catch(error => { info.push('Failed to retrieve public IP address'); document.getElementById('system-info').innerText = info.join('\n'); }); } window.onload = getSystemInfo;