MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / browserOpenCommand

Function browserOpenCommand

apps/cli/src/device-login.ts:374–383  ·  view source on GitHub ↗
(
  url: string,
  platform: typeof process.platform = process.platform,
)

Source from the content-addressed store, hash-verified

372};
373
374export 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. */
386export const openBrowser = (url: string): void => {

Callers 2

openBrowserFunction · 0.85

Calls 1

normalizeBrowserOpenUrlFunction · 0.85

Tested by

no test coverage detected