MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / openBrowser

Function openBrowser

cli/src/commands/login.ts:21–39  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

19const LOGIN_TIMEOUT_MS = 2 * 60 * 1000;
20
21function openBrowser(url: string): void {
22 if (process.platform === "win32") {
23 const child = execFile("cmd", ["/c", "start", "", url], (err) => {
24 if (err) {
25 process.stderr.write(`Could not open browser. Visit manually: ${url}\n`);
26 }
27 });
28 child.unref();
29 return;
30 }
31
32 const cmd = process.platform === "darwin" ? "open" : "xdg-open";
33 const child = execFile(cmd, [url], (err) => {
34 if (err) {
35 process.stderr.write(`Could not open browser. Visit manually: ${url}\n`);
36 }
37 });
38 child.unref();
39}
40
41function renderCallbackPage(title: string, message: string): string {
42 return `<!doctype html>

Callers 1

waitForBrowserLoginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected