We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ac5847 commit 27330e5Copy full SHA for 27330e5
src/tools/attach-to-browser.ts
@@ -13,6 +13,11 @@ const attachToBrowserCb: ToolCallback<typeof attachToBrowserSchema> = async args
13
const browserContext = new BrowserContext({}, session as SessionOptions);
14
await browserContext.get();
15
16
+ if (await contextProvider.getContext().browser.isActive()) {
17
+ console.error("Closing existing browser");
18
+ await contextProvider.getContext().browser.close();
19
+ }
20
+
21
contextProvider.setContext({
22
browser: browserContext,
23
} as Context);
0 commit comments