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

@@ -22,6 +22,10 @@ import type { FullConfig } from '../config.js';
export async function runWithExtension(config: FullConfig) {
const contextFactory = new ExtensionContextFactory(config.browser.launchOptions.channel || 'chrome');
const serverBackendFactory = () => new BrowserServerBackend(config, contextFactory);
const serverBackendFactory = () => new BrowserServerBackend(config, [contextFactory]);
await mcpTransport.start(serverBackendFactory, config.server);
}
export function createExtensionContextFactory(config: FullConfig) {
return new ExtensionContextFactory(config.browser.launchOptions.channel || 'chrome');
}