()
| 11 | } |
| 12 | |
| 13 | const isDefaultBrowserWindows = async () => { |
| 14 | try { |
| 15 | const httpProgId = execSync( |
| 16 | 'reg query HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice /v ProgId', |
| 17 | { encoding: 'utf-8' } |
| 18 | ).toString() |
| 19 | |
| 20 | const httpsProgId = execSync( |
| 21 | 'reg query HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\https\\UserChoice /v ProgId', |
| 22 | { encoding: 'utf-8' } |
| 23 | ).toString() |
| 24 | |
| 25 | const appProgId = 'ea.browser.deta.surf' |
| 26 | |
| 27 | const isHttpDefault = httpProgId.includes(appProgId) |
| 28 | const isHttpsDefault = httpsProgId.includes(appProgId) |
| 29 | |
| 30 | return isHttpDefault || isHttpsDefault |
| 31 | } catch (error) { |
| 32 | console.error('error checking default browser on Windows:', error) |
| 33 | return false |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | const isDefaultBrowserLinux = async () => { |
| 38 | return false |
no test coverage detected