chore: fix operation over cdp (#440)

Ref https://github.com/microsoft/playwright-mcp/issues/439
This commit is contained in:
Pavel Feldman
2025-05-17 08:20:22 -07:00
committed by GitHub
parent c2b7fb29de
commit 1318e39fac
4 changed files with 46 additions and 53 deletions

View File

@@ -40,6 +40,9 @@ export class PageSnapshot {
}
private async _build() {
// FIXME: Rountrip evaluate to ensure _snapshotForAI works.
// This probably broke once we moved off locator snapshots
await this._page.evaluate(() => 1);
const snapshot = await callOnPageNoTrace(this._page, page => (page as PageEx)._snapshotForAI());
this._text = [
`- Page Snapshot`,