( url: string, platform: typeof process.platform = process.platform, )
| 372 | }; |
| 373 | |
| 374 | export const browserOpenCommand = ( |
| 375 | url: string, |
| 376 | platform: typeof process.platform = process.platform, |
| 377 | ): BrowserOpenCommand | undefined => { |
| 378 | const normalizedUrl = normalizeBrowserOpenUrl(url); |
| 379 | if (!normalizedUrl) return undefined; |
| 380 | if (platform === "darwin") return ["open", [normalizedUrl]]; |
| 381 | if (platform === "win32") return ["rundll32.exe", ["url.dll,FileProtocolHandler", normalizedUrl]]; |
| 382 | return ["xdg-open", [normalizedUrl]]; |
| 383 | }; |
| 384 | |
| 385 | /** Best-effort open the verification URL in the user's default browser. */ |
| 386 | export const openBrowser = (url: string): void => { |
no test coverage detected