Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"native-keymap": "^3.3.5",
"node-pty": "^1.2.0-beta.12",
"open": "^10.1.2",
"playwright-core": "1.59.0-alpha-2026-02-20",
"playwright-core": "1.59.0-alpha-2026-03-19",
"tas-client": "0.3.1",
"undici": "^7.24.0",
"v8-inspect-profiler": "^0.1.1",
Expand Down
11 changes: 2 additions & 9 deletions src/vs/platform/browserView/node/playwrightTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ import { Emitter, Event } from '../../../base/common/event.js';
import { CancellationToken } from '../../../base/common/cancellation.js';
import { createCancelablePromise, raceCancellablePromises } from '../../../base/common/async.js';

declare module 'playwright-core' {
interface Page {
// A hidden Playwright method that returns an AI-friendly snapshot of the page.
_snapshotForAI(options?: { track?: string }): Promise<{ full: string; incremental?: string }>;
}
}

/**
* Wrapper around a Playwright page that tracks additional state like active dialogs and recent console messages,
* and can produce a summary of the page's current state for use in tools.
Expand Down Expand Up @@ -165,7 +158,7 @@ export class PlaywrightTab {
this._needsFullSnapshot = false;
}

const snapshotFromPage = await this.safeRunAgainstPage((page) => page._snapshotForAI({ track: 'response' })).catch(() => {
const snapshotFromPage = await this.safeRunAgainstPage((page) => page.snapshotForAI({ track: 'response', mode: full ? 'full' : 'incremental' })).catch(() => {
this._needsFullSnapshot = true;
return undefined;
});
Comment on lines +161 to 164
Expand All @@ -174,7 +167,7 @@ export class PlaywrightTab {
const logs = this._logs;
this._logs = [];

const snapshot = (full ? snapshotFromPage?.full : snapshotFromPage?.incremental ?? snapshotFromPage?.full)?.trim() ?? '';
const snapshot = snapshotFromPage?.trim() ?? '';

return [
...(title ? [`Page Title: ${title}`] : []),
Expand Down
Loading