MCPcopy Create free account
hub / github.com/deta/surf / isDefaultBrowserWindows

Function isDefaultBrowserWindows

app/src/main/utils.ts:13–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11}
12
13const 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
37const isDefaultBrowserLinux = async () => {
38 return false

Callers 1

isDefaultBrowserFunction · 0.85

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected