chore: use persistent profile by default (#41)
Fixes https://github.com/microsoft/playwright-mcp/issues/29
This commit is contained in:
parent
5345a7b4df
commit
6ff4500211
11 changed files with 122 additions and 69 deletions
17
src/index.ts
17
src/index.ts
|
|
@ -61,18 +61,21 @@ const resources: Resource[] = [
|
|||
];
|
||||
|
||||
type Options = {
|
||||
vision?: boolean;
|
||||
userDataDir?: string;
|
||||
launchOptions?: LaunchOptions;
|
||||
vision?: boolean;
|
||||
};
|
||||
|
||||
const packageJSON = require('../package.json');
|
||||
|
||||
export function createServer(options?: Options): Server {
|
||||
const tools = options?.vision ? screenshotTools : snapshotTools;
|
||||
return createServerWithTools(
|
||||
'Playwright',
|
||||
packageJSON.version,
|
||||
tools,
|
||||
resources,
|
||||
options?.launchOptions);
|
||||
return createServerWithTools({
|
||||
name: 'Playwright',
|
||||
version: packageJSON.version,
|
||||
tools,
|
||||
resources,
|
||||
userDataDir: options?.userDataDir ?? '',
|
||||
launchOptions: options?.launchOptions,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue