chore: introduce browser_evaluate (#678)
Fixes https://github.com/microsoft/playwright-mcp/issues/424
This commit is contained in:
parent
825a97d66e
commit
012c906500
9 changed files with 127 additions and 36 deletions
|
|
@ -190,19 +190,19 @@ ${code.join('\n')}
|
|||
result.push('');
|
||||
}
|
||||
|
||||
if (this.tabs().length > 1)
|
||||
result.push(await this.listTabsMarkdown(), '');
|
||||
if (captureSnapshot && tab.hasSnapshot()) {
|
||||
if (this.tabs().length > 1)
|
||||
result.push(await this.listTabsMarkdown(), '');
|
||||
|
||||
if (this.tabs().length > 1)
|
||||
result.push('### Current tab');
|
||||
if (this.tabs().length > 1)
|
||||
result.push('### Current tab');
|
||||
|
||||
result.push(
|
||||
`- Page URL: ${tab.page.url()}`,
|
||||
`- Page Title: ${await tab.title()}`
|
||||
);
|
||||
|
||||
if (captureSnapshot && tab.hasSnapshot())
|
||||
result.push(
|
||||
`- Page URL: ${tab.page.url()}`,
|
||||
`- Page Title: ${await tab.title()}`
|
||||
);
|
||||
result.push(tab.snapshotOrDie().text());
|
||||
}
|
||||
|
||||
const content = actionResult?.content ?? [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue