chore: allow reusing tab over cdp (#170)

Fixes https://github.com/microsoft/playwright-mcp/issues/164
This commit is contained in:
Pavel Feldman 2025-04-14 16:39:58 -07:00 committed by GitHub
parent e729494bd9
commit 606b898a71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 63 additions and 21 deletions

View file

@ -89,7 +89,7 @@ const closeTab: ToolFactory = captureSnapshot => ({
handle: async (context, params) => {
const validatedParams = closeTabSchema.parse(params);
await context.closeTab(validatedParams.index);
const currentTab = await context.currentTab();
const currentTab = context.currentTab();
if (currentTab)
return await currentTab.run(async () => {}, { captureSnapshot });
return {