diff --git a/app/commit.json b/app/commit.json index 5bb6596..fd14931 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "d479daa5781a533c68a6f9ffdb3b919914c9305e" } +{ "commit": "85b0322fd6e9c2760805e6372c487fb0432955de" } diff --git a/app/components/settings/debug/DebugTab.tsx b/app/components/settings/debug/DebugTab.tsx index e18607d..03f2fa8 100644 --- a/app/components/settings/debug/DebugTab.tsx +++ b/app/components/settings/debug/DebugTab.tsx @@ -21,6 +21,12 @@ interface SystemInfo { timezone: string; memory: string; cores: number; + deviceType: string; + colorDepth: string; + pixelRatio: number; + online: boolean; + cookiesEnabled: boolean; + doNotTrack: boolean; } interface IProviderConfig { @@ -50,14 +56,100 @@ function getSystemInfo(): SystemInfo { return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; }; + const getBrowserInfo = (): string => { + const ua = navigator.userAgent; + let browser = 'Unknown'; + + if (ua.includes('Firefox/')) { + browser = 'Firefox'; + } else if (ua.includes('Chrome/')) { + if (ua.includes('Edg/')) { + browser = 'Edge'; + } else if (ua.includes('OPR/')) { + browser = 'Opera'; + } else { + browser = 'Chrome'; + } + } else if (ua.includes('Safari/')) { + if (!ua.includes('Chrome')) { + browser = 'Safari'; + } + } + + // Extract version number + const match = ua.match(new RegExp(`${browser}\\/([\\d.]+)`)); + const version = match ? ` ${match[1]}` : ''; + + return `${browser}${version}`; + }; + + const getOperatingSystem = (): string => { + const ua = navigator.userAgent; + const platform = navigator.platform; + + if (ua.includes('Win')) { + return 'Windows'; + } + + if (ua.includes('Mac')) { + if (ua.includes('iPhone') || ua.includes('iPad')) { + return 'iOS'; + } + + return 'macOS'; + } + + if (ua.includes('Linux')) { + return 'Linux'; + } + + if (ua.includes('Android')) { + return 'Android'; + } + + return platform || 'Unknown'; + }; + + const getDeviceType = (): string => { + const ua = navigator.userAgent; + + if (ua.includes('Mobile')) { + return 'Mobile'; + } + + if (ua.includes('Tablet')) { + return 'Tablet'; + } + + return 'Desktop'; + }; + + // Get more detailed memory info if available + const getMemoryInfo = (): string => { + if ('memory' in performance) { + const memory = (performance as any).memory; + return `${formatBytes(memory.jsHeapSizeLimit)} (Used: ${formatBytes(memory.usedJSHeapSize)})`; + } + + return 'Not available'; + }; + return { - os: navigator.platform, - browser: navigator.userAgent.split(' ').slice(-1)[0], + os: getOperatingSystem(), + browser: getBrowserInfo(), screen: `${window.screen.width}x${window.screen.height}`, language: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, - memory: formatBytes(performance?.memory?.jsHeapSizeLimit || 0), + memory: getMemoryInfo(), cores: navigator.hardwareConcurrency || 0, + deviceType: getDeviceType(), + + // Add new fields + colorDepth: `${window.screen.colorDepth}-bit`, + pixelRatio: window.devicePixelRatio, + online: navigator.onLine, + cookiesEnabled: navigator.cookieEnabled, + doNotTrack: navigator.doNotTrack === '1', }; } @@ -371,10 +463,31 @@ export default function DebugTab() {
Operating System
{systemInfo.os}
+Device Type
+{systemInfo.deviceType}
+Browser
{systemInfo.browser}
Display
++ {systemInfo.screen} ({systemInfo.colorDepth}) @{systemInfo.pixelRatio}x +
+Connection
++ + + {systemInfo.online ? 'Online' : 'Offline'} + +
+Screen Resolution
{systemInfo.screen}