chore: allow configuring raw Playwright options (#287)
Fixes: https://github.com/microsoft/playwright-mcp/issues/272
This commit is contained in:
@@ -19,7 +19,6 @@ import path from 'path';
|
||||
|
||||
import { z } from 'zod';
|
||||
import { defineTool } from './tool';
|
||||
import { toBrowserOptions } from '../config';
|
||||
|
||||
const install = defineTool({
|
||||
capability: 'install',
|
||||
@@ -30,8 +29,7 @@ const install = defineTool({
|
||||
},
|
||||
|
||||
handle: async context => {
|
||||
const browserOptions = await toBrowserOptions(context.config);
|
||||
const channel = browserOptions.launchOptions?.channel ?? browserOptions.browserName ?? 'chrome';
|
||||
const channel = context.config.browser?.launchOptions?.channel ?? context.config.browser?.launchOptions.channel ?? context.config.browser?.launchOptions.browserName ?? 'chrome';
|
||||
const cli = path.join(require.resolve('playwright/package.json'), '..', 'cli.js');
|
||||
const child = fork(cli, ['install', channel], {
|
||||
stdio: 'pipe',
|
||||
|
||||
Reference in New Issue
Block a user