* Register the native host in Windows registry for all supported browsers
(manifestPath: string)
| 269 | * Register the native host in Windows registry for all supported browsers |
| 270 | */ |
| 271 | function registerWindowsNativeHosts(manifestPath: string): void { |
| 272 | const registryKeys = getAllWindowsRegistryKeys() |
| 273 | |
| 274 | for (const { browser, key } of registryKeys) { |
| 275 | const fullKey = `${key}\\${NATIVE_HOST_IDENTIFIER}` |
| 276 | // Use reg.exe to add the registry entry |
| 277 | // https://developer.chrome.com/docs/extensions/develop/concepts/native-messaging |
| 278 | void execFileNoThrowWithCwd('reg', [ |
| 279 | 'add', |
| 280 | fullKey, |
| 281 | '/ve', // Set the default (unnamed) value |
| 282 | '/t', |
| 283 | 'REG_SZ', |
| 284 | '/d', |
| 285 | manifestPath, |
| 286 | '/f', // Force overwrite without prompt |
| 287 | ]).then(result => { |
| 288 | if (result.code === 0) { |
| 289 | logForDebugging( |
| 290 | `[Claude in Chrome] Registered native host for ${browser} in Windows registry: ${fullKey}`, |
| 291 | ) |
| 292 | } else { |
| 293 | logForDebugging( |
| 294 | `[Claude in Chrome] Failed to register native host for ${browser} in Windows registry: ${result.stderr}`, |
| 295 | ) |
| 296 | } |
| 297 | }) |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | /** |
| 302 | * Create a wrapper script in ~/.claude/chrome/ that invokes the given command. This is |
no test coverage detected