MCPcopy Create free account
hub / github.com/CopilotKit/OpenTag / closeBrowser

Function closeBrowser

app/render/browser.ts:26–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26export async function closeBrowser(): Promise<void> {
27 if (!browserPromise) return;
28 // Claim shutdown and detach the promise BEFORE awaiting, so a concurrent
29 // getBrowser() rejects cleanly instead of handing back a browser we're
30 // about to close out from under it.
31 closing = true;
32 const pending = browserPromise;
33 browserPromise = undefined;
34 const b = await pending.catch(() => undefined);
35 await b?.close().catch(() => {});
36}

Callers 1

shutdownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected