mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2026-02-03 08:53:38 +00:00
chore: roll playwright to latest (#269)
This commit is contained in:
10
src/index.ts
10
src/index.ts
@@ -34,7 +34,7 @@ import screen from './tools/screen';
|
||||
|
||||
import type { Tool, ToolCapability } from './tools/tool';
|
||||
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
||||
import type { LaunchOptions } from 'playwright';
|
||||
import type { LaunchOptions, BrowserContextOptions } from 'playwright';
|
||||
|
||||
const snapshotTools: Tool<any>[] = [
|
||||
...common(true),
|
||||
@@ -84,6 +84,7 @@ export async function createServer(options?: Options): Promise<Server> {
|
||||
case 'chrome-beta':
|
||||
case 'chrome-canary':
|
||||
case 'chrome-dev':
|
||||
case 'chromium':
|
||||
case 'msedge':
|
||||
case 'msedge-beta':
|
||||
case 'msedge-canary':
|
||||
@@ -91,9 +92,6 @@ export async function createServer(options?: Options): Promise<Server> {
|
||||
browserName = 'chromium';
|
||||
channel = options.browser;
|
||||
break;
|
||||
case 'chromium':
|
||||
browserName = 'chromium';
|
||||
break;
|
||||
case 'firefox':
|
||||
browserName = 'firefox';
|
||||
break;
|
||||
@@ -106,10 +104,12 @@ export async function createServer(options?: Options): Promise<Server> {
|
||||
}
|
||||
const userDataDir = options?.userDataDir ?? await createUserDataDir(browserName);
|
||||
|
||||
const launchOptions: LaunchOptions = {
|
||||
const launchOptions: LaunchOptions & BrowserContextOptions = {
|
||||
headless: !!(options?.headless ?? (os.platform() === 'linux' && !process.env.DISPLAY)),
|
||||
channel,
|
||||
executablePath: options?.executablePath,
|
||||
viewport: null,
|
||||
...{ assistantMode: true },
|
||||
};
|
||||
|
||||
const allTools = options?.vision ? screenshotTools : snapshotTools;
|
||||
|
||||
Reference in New Issue
Block a user