MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / openBrowser

Function openBrowser

src/ui-server/open-browser.ts:64–82  ·  view source on GitHub ↗
(url: string, platform: NodeJS.Platform = process.platform)

Source from the content-addressed store, hash-verified

62 * @returns `true` if a launch was attempted.
63 */
64export function openBrowser(url: string, platform: NodeJS.Platform = process.platform): boolean {
65 const open = browserOpenCommand(url, platform, process.env[BROWSER_ENV]);
66 if (!open) return false;
67 try {
68 const child = spawn(open.command, open.args, {
69 detached: true,
70 stdio: 'ignore',
71 // `start` is a shell builtin reached through `cmd /c`, so no shell here.
72 shell: false,
73 });
74 child.on('error', () => {
75 /* no opener installed — the printed URL is the fallback */
76 });
77 child.unref();
78 return true;
79 } catch {
80 return false;
81 }
82}

Callers 1

mainFunction · 0.85

Calls 3

browserOpenCommandFunction · 0.85
spawnFunction · 0.85
onMethod · 0.65

Tested by

no test coverage detected