Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(mcp): throw clear error for tab creation in extension protocol v1 (#40261)

Yury Semikhatsky2fb4b68f4180
diff --git a/packages/playwright-core/src/tools/mcp/cdpRelayV1.ts b/packages/playwright-core/src/tools/mcp/cdpRelayV1.ts
index aa9201ef0f..3aff2addae 100644
--- a/packages/playwright-core/src/tools/mcp/cdpRelayV1.ts
+++ b/packages/playwright-core/src/tools/mcp/cdpRelayV1.ts
@@ -74,6 +74,9 @@ export class ExtensionProtocolV1 implements ExtensionProtocolHandler {
case 'Target.getTargetInfo': {
return { result: this._connectedTabInfo?.targetInfo };
}
+ case 'Target.createTarget': {
+ throw new Error('Tab creation is not supported yet.');
+ }
}
return undefined;
}