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
|
|
@ -29,7 +29,7 @@ export const screenshot: Tool = {
|
|||
},
|
||||
|
||||
handle: async context => {
|
||||
const page = await context.ensurePage();
|
||||
const page = await context.existingPage();
|
||||
const screenshot = await page.screenshot({ type: 'jpeg', quality: 50, scale: 'css' });
|
||||
return {
|
||||
content: [{ type: 'image', data: screenshot.toString('base64'), mimeType: 'image/jpeg' }],
|
||||
|
|
@ -55,7 +55,7 @@ export const moveMouse: Tool = {
|
|||
|
||||
handle: async (context, params) => {
|
||||
const validatedParams = moveMouseSchema.parse(params);
|
||||
const page = await context.ensurePage();
|
||||
const page = await context.existingPage();
|
||||
await page.mouse.move(validatedParams.x, validatedParams.y);
|
||||
return {
|
||||
content: [{ type: 'text', text: `Moved mouse to (${validatedParams.x}, ${validatedParams.y})` }],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue