@@ -58,7 +58,32 @@ function DebugInfo({ error, step, selectedDevice, serial, message }) {
5858 const deviceName = selectedDevice === DeviceType . COMMA_4 ? 'comma four' : selectedDevice === DeviceType . COMMA_3 ? 'comma 3/3X' : 'unknown'
5959 const errorName = Object . keys ( ErrorCode ) . find ( k => ErrorCode [ k ] === error ) || 'UNKNOWN'
6060 const stepName = Object . keys ( StepCode ) . find ( k => StepCode [ k ] === step ) || 'UNKNOWN'
61- const platform = isWindows ? 'Windows' : isLinux ? 'Linux' : 'macOS'
61+
62+ // Get detailed OS info
63+ const ua = navigator . userAgent
64+ let os = 'Unknown'
65+ if ( ua . includes ( 'Windows NT 10.0' ) ) os = 'Windows 10/11'
66+ else if ( ua . includes ( 'Windows NT 6.3' ) ) os = 'Windows 8.1'
67+ else if ( ua . includes ( 'Windows NT 6.2' ) ) os = 'Windows 8'
68+ else if ( ua . includes ( 'Windows NT 6.1' ) ) os = 'Windows 7'
69+ else if ( ua . includes ( 'Mac OS X' ) ) {
70+ const match = ua . match ( / M a c O S X ( \d + [ . _ ] \d + [ . _ ] ? \d * ) / )
71+ os = match ? `macOS ${ match [ 1 ] . replace ( / _ / g, '.' ) } ` : 'macOS'
72+ } else if ( ua . includes ( 'Linux' ) ) {
73+ os = 'Linux'
74+ if ( ua . includes ( 'Ubuntu' ) ) os += ' (Ubuntu)'
75+ else if ( ua . includes ( 'Fedora' ) ) os += ' (Fedora)'
76+ else if ( ua . includes ( 'Debian' ) ) os += ' (Debian)'
77+ } else if ( ua . includes ( 'CrOS' ) ) os = 'ChromeOS'
78+
79+ // Detect sandboxed browsers
80+ const sandboxHints = [ ]
81+ if ( ua . includes ( 'snap' ) ) sandboxHints . push ( 'Snap' )
82+ if ( ua . includes ( 'Flatpak' ) ) sandboxHints . push ( 'Flatpak' )
83+ if ( navigator . userAgentData ?. brands ?. some ( b => b . brand . includes ( 'snap' ) ) ) sandboxHints . push ( 'Snap' )
84+ // Snap Chrome often has restricted /dev access which breaks WebUSB
85+ if ( isLinux && ! navigator . usb ) sandboxHints . push ( 'WebUSB unavailable - possibly sandboxed' )
86+ const sandbox = sandboxHints . length ? sandboxHints . join ( ', ' ) : 'None detected'
6287
6388 return `## Bug Report - flash.comma.ai
6489
@@ -68,8 +93,9 @@ function DebugInfo({ error, step, selectedDevice, serial, message }) {
6893**Step:** ${ stepName }
6994**Last Message:** ${ message || 'N/A' }
7095
96+ **OS:** ${ os }
97+ **Sandbox:** ${ sandbox }
7198**Browser:** ${ navigator . userAgent }
72- **Platform:** ${ platform }
7399**URL:** ${ window . location . href }
74100**Time:** ${ new Date ( ) . toISOString ( ) }
75101
0 commit comments