()
| 278 | * Get native messaging host directories for all supported browsers |
| 279 | */ |
| 280 | export function getAllNativeMessagingHostsDirs(): { |
| 281 | browser: ChromiumBrowser |
| 282 | path: string |
| 283 | }[] { |
| 284 | const platform = getPlatform() |
| 285 | const home = homedir() |
| 286 | const paths: { browser: ChromiumBrowser; path: string }[] = [] |
| 287 | |
| 288 | for (const browserId of BROWSER_DETECTION_ORDER) { |
| 289 | const config = CHROMIUM_BROWSERS[browserId] |
| 290 | |
| 291 | switch (platform) { |
| 292 | case 'macos': |
| 293 | if (config.macos.nativeMessagingPath.length > 0) { |
| 294 | paths.push({ |
| 295 | browser: browserId, |
| 296 | path: join(home, ...config.macos.nativeMessagingPath), |
| 297 | }) |
| 298 | } |
| 299 | break |
| 300 | case 'linux': |
| 301 | case 'wsl': |
| 302 | if (config.linux.nativeMessagingPath.length > 0) { |
| 303 | paths.push({ |
| 304 | browser: browserId, |
| 305 | path: join(home, ...config.linux.nativeMessagingPath), |
| 306 | }) |
| 307 | } |
| 308 | break |
| 309 | case 'windows': |
| 310 | // Windows uses registry, not file paths for native messaging |
| 311 | // We'll use a common location for the manifest file |
| 312 | break |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | return paths |
| 317 | } |
| 318 | |
| 319 | /** |
| 320 | * Get Windows registry keys for all supported browsers |
no test coverage detected