chore: allow to switch between browser connection methods (#815)

This commit is contained in:
Yury Semikhatsky
2025-08-01 17:34:28 -07:00
committed by GitHub
parent a60d7b8cd1
commit 372395666a
8 changed files with 87 additions and 14 deletions

View File

@@ -46,7 +46,7 @@ export class Context {
static async create(config: FullConfig) {
const client = new Client({ name: 'Playwright Proxy', version: '1.0.0' });
const browserContextFactory = contextFactory(config);
const server = mcpServer.createServer(new BrowserServerBackend(config, browserContextFactory), false);
const server = mcpServer.createServer(new BrowserServerBackend(config, [browserContextFactory]), false);
await client.connect(new InProcessTransport(server));
await client.ping();
return new Context(config, client);