Add SPA session validation and buglist, update migration docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-03 21:28:08 +00:00
parent 9be3dfc14e
commit cff287e870
24169 changed files with 10223 additions and 7120 deletions

31
node_modules/playwright/lib/mcp/browser/response.js generated vendored Normal file → Executable file
View File

@@ -31,7 +31,7 @@ class Response {
this._result = [];
this._code = [];
this._images = [];
this._includeSnapshot = false;
this._includeSnapshot = "none";
this._includeTabs = false;
this._context = context;
this.toolName = toolName;
@@ -62,14 +62,14 @@ class Response {
images() {
return this._images;
}
setIncludeSnapshot() {
this._includeSnapshot = true;
setIncludeSnapshot(full) {
this._includeSnapshot = full ?? "incremental";
}
setIncludeTabs() {
this._includeTabs = true;
}
async finish() {
if (this._includeSnapshot && this._context.currentTab())
if (this._includeSnapshot !== "none" && this._context.currentTab())
this._tabSnapshot = await this._context.currentTabOrDie().captureSnapshot();
for (const tab of this._context.tabs())
await tab.updateTitle();
@@ -99,13 +99,14 @@ ${this._code.join("\n")}
\`\`\``);
response.push("");
}
if (this._includeSnapshot || this._includeTabs)
if (this._includeSnapshot !== "none" || this._includeTabs)
response.push(...renderTabsMarkdown(this._context.tabs(), this._includeTabs));
if (this._tabSnapshot?.modalStates.length) {
response.push(...(0, import_tab.renderModalStates)(this._context, this._tabSnapshot.modalStates));
response.push("");
} else if (this._tabSnapshot) {
response.push(renderTabSnapshot(this._tabSnapshot, options));
const includeSnapshot = options.omitSnapshot ? "none" : this._includeSnapshot;
response.push(renderTabSnapshot(this._tabSnapshot, includeSnapshot));
response.push("");
}
const content = [
@@ -129,7 +130,7 @@ ${this._code.join("\n")}
}
}
}
function renderTabSnapshot(tabSnapshot, options = {}) {
function renderTabSnapshot(tabSnapshot, includeSnapshot) {
const lines = [];
if (tabSnapshot.consoleMessages.length) {
lines.push(`### New console messages`);
@@ -147,13 +148,21 @@ function renderTabSnapshot(tabSnapshot, options = {}) {
}
lines.push("");
}
if (includeSnapshot === "incremental" && tabSnapshot.ariaSnapshotDiff === "") {
return lines.join("\n");
}
lines.push(`### Page state`);
lines.push(`- Page URL: ${tabSnapshot.url}`);
lines.push(`- Page Title: ${tabSnapshot.title}`);
lines.push(`- Page Snapshot:`);
lines.push("```yaml");
lines.push(options.omitSnapshot ? "<snapshot>" : tabSnapshot.ariaSnapshot);
lines.push("```");
if (includeSnapshot !== "none") {
lines.push(`- Page Snapshot:`);
lines.push("```yaml");
if (includeSnapshot === "incremental" && tabSnapshot.ariaSnapshotDiff !== void 0)
lines.push(tabSnapshot.ariaSnapshotDiff);
else
lines.push(tabSnapshot.ariaSnapshot);
lines.push("```");
}
return lines.join("\n");
}
function renderTabsMarkdown(tabs, force = false) {