chore: allow passing cdp endpoint (#86)
Fixes https://github.com/microsoft/playwright-mcp/issues/84
This commit is contained in:
@@ -21,20 +21,18 @@ import { Context } from './context';
|
||||
|
||||
import type { Tool } from './tools/tool';
|
||||
import type { Resource } from './resources/resource';
|
||||
import type { LaunchOptions } from 'playwright';
|
||||
import type { ContextOptions } from './context';
|
||||
|
||||
type Options = {
|
||||
type Options = ContextOptions & {
|
||||
name: string;
|
||||
version: string;
|
||||
tools: Tool[];
|
||||
resources: Resource[],
|
||||
userDataDir: string;
|
||||
launchOptions?: LaunchOptions;
|
||||
};
|
||||
|
||||
export function createServerWithTools(options: Options): Server {
|
||||
const { name, version, tools, resources, userDataDir, launchOptions } = options;
|
||||
const context = new Context(userDataDir, launchOptions);
|
||||
const { name, version, tools, resources } = options;
|
||||
const context = new Context(options);
|
||||
const server = new Server({ name, version }, {
|
||||
capabilities: {
|
||||
tools: {},
|
||||
|
||||
Reference in New Issue
Block a user