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

Function browserOpenCommand

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

Source from the content-addressed store, hash-verified

323};
324
325export const browserOpenCommand = (
326 url: string,
327 platform: typeof process.platform = process.platform,
328): BrowserOpenCommand | undefined => {
329 const normalizedUrl = normalizeBrowserOpenUrl(url);
330 if (!normalizedUrl) return undefined;
331 if (platform === "darwin") return ["open", [normalizedUrl]];
332 if (platform === "win32") return ["rundll32.exe", ["url.dll,FileProtocolHandler", normalizedUrl]];
333 return ["xdg-open", [normalizedUrl]];
334};
335
336/** Best-effort open the verification URL in the user's default browser. */
337export const openBrowser = (url: string): void => {

Callers 2

openBrowserFunction · 0.85

Calls 1

normalizeBrowserOpenUrlFunction · 0.85

Tested by

no test coverage detected