| 276 | } |
| 277 | |
| 278 | function getNativeHostDirs(osName) { |
| 279 | if (osName === "darwin") { |
| 280 | const base = join(homedir(), "Library", "Application Support"); |
| 281 | return [ |
| 282 | join(base, "Google", "Chrome", "NativeMessagingHosts"), |
| 283 | join(base, "Chromium", "NativeMessagingHosts"), |
| 284 | join(base, "BraveSoftware", "Brave-Browser", "NativeMessagingHosts"), |
| 285 | ]; |
| 286 | } |
| 287 | |
| 288 | // linux |
| 289 | const base = join(homedir(), ".config"); |
| 290 | return [ |
| 291 | join(base, "google-chrome", "NativeMessagingHosts"), |
| 292 | join(base, "chromium", "NativeMessagingHosts"), |
| 293 | join(base, "BraveSoftware", "Brave-Browser", "NativeMessagingHosts"), |
| 294 | ]; |
| 295 | } |
| 296 | |
| 297 | function nativeHostManifestPath(dir) { |
| 298 | return join(dir, `${NATIVE_HOST_NAME}.json`); |