* Get native messaging hosts directories for all supported browsers * Returns an array of directories where the native host manifest should be installed
()
| 175 | * Returns an array of directories where the native host manifest should be installed |
| 176 | */ |
| 177 | function getNativeMessagingHostsDirs(): string[] { |
| 178 | const platform = getPlatform() |
| 179 | |
| 180 | if (platform === 'windows') { |
| 181 | // Windows uses a single location with registry entries pointing to it |
| 182 | const home = homedir() |
| 183 | const appData = process.env.APPDATA || join(home, 'AppData', 'Local') |
| 184 | return [join(appData, 'Claude Code', 'ChromeNativeHost')] |
| 185 | } |
| 186 | |
| 187 | // macOS and Linux: return all browser native messaging directories |
| 188 | return getAllNativeMessagingHostsDirs().map(({ path }) => path) |
| 189 | } |
| 190 | |
| 191 | export async function installChromeNativeHostManifest( |
| 192 | manifestBinaryPath: string, |
no test coverage detected