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

View File

@@ -1,49 +0,0 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var accessibility_exports = {};
__export(accessibility_exports, {
Accessibility: () => Accessibility
});
module.exports = __toCommonJS(accessibility_exports);
function axNodeFromProtocol(axNode) {
const result = {
...axNode,
value: axNode.valueNumber !== void 0 ? axNode.valueNumber : axNode.valueString,
checked: axNode.checked === "checked" ? true : axNode.checked === "unchecked" ? false : axNode.checked,
pressed: axNode.pressed === "pressed" ? true : axNode.pressed === "released" ? false : axNode.pressed,
children: axNode.children ? axNode.children.map(axNodeFromProtocol) : void 0
};
delete result.valueNumber;
delete result.valueString;
return result;
}
class Accessibility {
constructor(channel) {
this._channel = channel;
}
async snapshot(options = {}) {
const root = options.root ? options.root._elementChannel : void 0;
const result = await this._channel.accessibilitySnapshot({ interestingOnly: options.interestingOnly, root });
return result.rootAXNode ? axNodeFromProtocol(result.rootAXNode) : null;
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Accessibility
});

0
node_modules/playwright-core/lib/client/android.js generated vendored Normal file → Executable file
View File

3
node_modules/playwright-core/lib/client/api.js generated vendored Normal file → Executable file
View File

@@ -21,7 +21,6 @@ __export(api_exports, {
APIRequest: () => import_fetch.APIRequest,
APIRequestContext: () => import_fetch.APIRequestContext,
APIResponse: () => import_fetch.APIResponse,
Accessibility: () => import_accessibility.Accessibility,
Android: () => import_android.Android,
AndroidDevice: () => import_android.AndroidDevice,
AndroidInput: () => import_android.AndroidInput,
@@ -62,7 +61,6 @@ __export(api_exports, {
Worker: () => import_worker.Worker
});
module.exports = __toCommonJS(api_exports);
var import_accessibility = require("./accessibility");
var import_android = require("./android");
var import_browser = require("./browser");
var import_browserContext = require("./browserContext");
@@ -95,7 +93,6 @@ var import_webError = require("./webError");
APIRequest,
APIRequestContext,
APIResponse,
Accessibility,
Android,
AndroidDevice,
AndroidInput,

0
node_modules/playwright-core/lib/client/artifact.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/browser.js generated vendored Normal file → Executable file
View File

26
node_modules/playwright-core/lib/client/browserContext.js generated vendored Normal file → Executable file
View File

@@ -89,11 +89,19 @@ class BrowserContext extends import_channelOwner.ChannelOwner {
this.emit(import_events.Events.BrowserContext.ServiceWorker, serviceWorker);
});
this._channel.on("console", (event) => {
const consoleMessage = new import_consoleMessage.ConsoleMessage(this._platform, event, import_page.Page.fromNullable(event.page));
const worker = import_worker.Worker.fromNullable(event.worker);
const page = import_page.Page.fromNullable(event.page);
const consoleMessage = new import_consoleMessage.ConsoleMessage(this._platform, event, page, worker);
worker?.emit(import_events.Events.Worker.Console, consoleMessage);
page?.emit(import_events.Events.Page.Console, consoleMessage);
if (worker && this._serviceWorkers.has(worker)) {
const scope = this._serviceWorkerScope(worker);
for (const page2 of this._pages) {
if (scope && page2.url().startsWith(scope))
page2.emit(import_events.Events.Page.Console, consoleMessage);
}
}
this.emit(import_events.Events.BrowserContext.Console, consoleMessage);
const page = consoleMessage.page();
if (page)
page.emit(import_events.Events.Page.Console, consoleMessage);
});
this._channel.on("pageError", ({ error, page }) => {
const pageObject = import_page.Page.from(page);
@@ -230,6 +238,16 @@ class BrowserContext extends import_channelOwner.ChannelOwner {
return;
await bindingCall.call(func);
}
_serviceWorkerScope(serviceWorker) {
try {
let url = new URL(".", serviceWorker.url()).href;
if (!url.endsWith("/"))
url += "/";
return url;
} catch {
return null;
}
}
setDefaultNavigationTimeout(timeout) {
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
}

0
node_modules/playwright-core/lib/client/browserType.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/cdpSession.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/channelOwner.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/clientHelper.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/clientInstrumentation.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/clientStackTrace.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/clock.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/connection.js generated vendored Normal file → Executable file
View File

6
node_modules/playwright-core/lib/client/consoleMessage.js generated vendored Normal file → Executable file
View File

@@ -23,12 +23,16 @@ __export(consoleMessage_exports, {
module.exports = __toCommonJS(consoleMessage_exports);
var import_jsHandle = require("./jsHandle");
class ConsoleMessage {
constructor(platform, event, page) {
constructor(platform, event, page, worker) {
this._page = page;
this._worker = worker;
this._event = event;
if (platform.inspectCustom)
this[platform.inspectCustom] = () => this._inspect();
}
worker() {
return this._worker;
}
page() {
return this._page;
}

0
node_modules/playwright-core/lib/client/coverage.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/dialog.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/download.js generated vendored Normal file → Executable file
View File

2
node_modules/playwright-core/lib/client/electron.js generated vendored Normal file → Executable file
View File

@@ -66,7 +66,7 @@ class ElectronApplication extends import_channelOwner.ChannelOwner {
this._channel.on("close", () => {
this.emit(import_events.Events.ElectronApplication.Close);
});
this._channel.on("console", (event) => this.emit(import_events.Events.ElectronApplication.Console, new import_consoleMessage.ConsoleMessage(this._platform, event, null)));
this._channel.on("console", (event) => this.emit(import_events.Events.ElectronApplication.Console, new import_consoleMessage.ConsoleMessage(this._platform, event, null, null)));
this._setEventToSubscriptionMapping(/* @__PURE__ */ new Map([
[import_events.Events.ElectronApplication.Console, "console"]
]));

0
node_modules/playwright-core/lib/client/elementHandle.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/errors.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/eventEmitter.js generated vendored Normal file → Executable file
View File

3
node_modules/playwright-core/lib/client/events.js generated vendored Normal file → Executable file
View File

@@ -85,7 +85,8 @@ const Events = {
FrameSent: "framesent"
},
Worker: {
Close: "close"
Close: "close",
Console: "console"
},
ElectronApplication: {
Close: "close",

0
node_modules/playwright-core/lib/client/fetch.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/fileChooser.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/fileUtils.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/frame.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/harRouter.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/input.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/jsHandle.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/jsonPipe.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/localUtils.js generated vendored Normal file → Executable file
View File

5
node_modules/playwright-core/lib/client/locator.js generated vendored Normal file → Executable file
View File

@@ -167,6 +167,9 @@ class Locator {
describe(description) {
return new Locator(this._frame, this._selector + " >> internal:describe=" + JSON.stringify(description));
}
description() {
return (0, import_locatorGenerators.locatorCustomDescription)(this._selector) || null;
}
first() {
return new Locator(this._frame, this._selector + " >> nth=0");
}
@@ -298,7 +301,7 @@ class Locator {
return this.toString();
}
toString() {
return (0, import_locatorGenerators.asLocator)("javascript", this._selector);
return (0, import_locatorGenerators.asLocatorDescription)("javascript", this._selector);
}
}
class FrameLocator {

0
node_modules/playwright-core/lib/client/network.js generated vendored Normal file → Executable file
View File

7
node_modules/playwright-core/lib/client/page.js generated vendored Normal file → Executable file
View File

@@ -22,7 +22,6 @@ __export(page_exports, {
Page: () => Page
});
module.exports = __toCommonJS(page_exports);
var import_accessibility = require("./accessibility");
var import_artifact = require("./artifact");
var import_channelOwner = require("./channelOwner");
var import_clientHelper = require("./clientHelper");
@@ -65,7 +64,6 @@ class Page extends import_channelOwner.ChannelOwner {
this._locatorHandlers = /* @__PURE__ */ new Map();
this._browserContext = parent;
this._timeoutSettings = new import_timeoutSettings.TimeoutSettings(this._platform, this._browserContext._timeoutSettings);
this.accessibility = new import_accessibility.Accessibility(this._channel);
this.keyboard = new import_input.Keyboard(this);
this.mouse = new import_input.Mouse(this);
this.request = this._browserContext.request;
@@ -536,7 +534,7 @@ class Page extends import_channelOwner.ChannelOwner {
}
async consoleMessages() {
const { messages } = await this._channel.consoleMessages();
return messages.map((message) => new import_consoleMessage.ConsoleMessage(this._platform, message, this));
return messages.map((message) => new import_consoleMessage.ConsoleMessage(this._platform, message, this, null));
}
async pageErrors() {
const { errors } = await this._channel.pageErrors();
@@ -676,8 +674,7 @@ class Page extends import_channelOwner.ChannelOwner {
return result.pdf;
}
async _snapshotForAI(options = {}) {
const result = await this._channel.snapshotForAI({ timeout: this._timeoutSettings.timeout(options) });
return result.snapshot;
return await this._channel.snapshotForAI({ timeout: this._timeoutSettings.timeout(options), track: options.track });
}
}
class BindingCall extends import_channelOwner.ChannelOwner {

0
node_modules/playwright-core/lib/client/platform.js generated vendored Normal file → Executable file
View File

6
node_modules/playwright-core/lib/client/playwright.js generated vendored Normal file → Executable file
View File

@@ -43,10 +43,6 @@ class Playwright extends import_channelOwner.ChannelOwner {
this._android._playwright = this;
this._electron = import_electron.Electron.from(initializer.electron);
this._electron._playwright = this;
this._bidiChromium = import_browserType.BrowserType.from(initializer._bidiChromium);
this._bidiChromium._playwright = this;
this._bidiFirefox = import_browserType.BrowserType.from(initializer._bidiFirefox);
this._bidiFirefox._playwright = this;
this.devices = this._connection.localUtils()?.devices ?? {};
this.selectors = new import_selectors.Selectors(this._connection._platform);
this.errors = { TimeoutError: import_errors.TimeoutError };
@@ -55,7 +51,7 @@ class Playwright extends import_channelOwner.ChannelOwner {
return channel._object;
}
_browserTypes() {
return [this.chromium, this.firefox, this.webkit, this._bidiChromium, this._bidiFirefox];
return [this.chromium, this.firefox, this.webkit];
}
_preLaunchedBrowser() {
const browser = import_browser.Browser.from(this._initializer.preLaunchedBrowser);

0
node_modules/playwright-core/lib/client/selectors.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/stream.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/timeoutSettings.js generated vendored Normal file → Executable file
View File

10
node_modules/playwright-core/lib/client/tracing.js generated vendored Normal file → Executable file
View File

@@ -27,6 +27,7 @@ class Tracing extends import_channelOwner.ChannelOwner {
constructor(parent, type, guid, initializer) {
super(parent, type, guid, initializer);
this._includeSources = false;
this._isLive = false;
this._isTracing = false;
}
static from(channel) {
@@ -35,6 +36,7 @@ class Tracing extends import_channelOwner.ChannelOwner {
async start(options = {}) {
await this._wrapApiCall(async () => {
this._includeSources = !!options.sources;
this._isLive = !!options._live;
await this._channel.tracingStart({
name: options.name,
snapshots: options.snapshots,
@@ -42,13 +44,13 @@ class Tracing extends import_channelOwner.ChannelOwner {
live: options._live
});
const { traceName } = await this._channel.tracingStartChunk({ name: options.name, title: options.title });
await this._startCollectingStacks(traceName);
await this._startCollectingStacks(traceName, this._isLive);
});
}
async startChunk(options = {}) {
await this._wrapApiCall(async () => {
const { traceName } = await this._channel.tracingStartChunk(options);
await this._startCollectingStacks(traceName);
await this._startCollectingStacks(traceName, this._isLive);
});
}
async group(name, options = {}) {
@@ -57,12 +59,12 @@ class Tracing extends import_channelOwner.ChannelOwner {
async groupEnd() {
await this._channel.tracingGroupEnd();
}
async _startCollectingStacks(traceName) {
async _startCollectingStacks(traceName, live) {
if (!this._isTracing) {
this._isTracing = true;
this._connection.setIsTracing(true);
}
const result = await this._connection.localUtils()?.tracingStarted({ tracesDir: this._tracesDir, traceName });
const result = await this._connection.localUtils()?.tracingStarted({ tracesDir: this._tracesDir, traceName, live });
this._stacksId = result?.stacksId;
}
async stopChunk(options = {}) {

0
node_modules/playwright-core/lib/client/types.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/video.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/waiter.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/webError.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/client/webSocket.js generated vendored Normal file → Executable file
View File

22
node_modules/playwright-core/lib/client/worker.js generated vendored Normal file → Executable file
View File

@@ -26,11 +26,16 @@ var import_errors = require("./errors");
var import_events = require("./events");
var import_jsHandle = require("./jsHandle");
var import_manualPromise = require("../utils/isomorphic/manualPromise");
var import_timeoutSettings = require("./timeoutSettings");
var import_waiter = require("./waiter");
class Worker extends import_channelOwner.ChannelOwner {
constructor(parent, type, guid, initializer) {
super(parent, type, guid, initializer);
// Set for service workers.
this._closedScope = new import_manualPromise.LongStandingScope();
this._setEventToSubscriptionMapping(/* @__PURE__ */ new Map([
[import_events.Events.Worker.Console, "console"]
]));
this._channel.on("close", () => {
if (this._page)
this._page._workers.delete(this);
@@ -40,6 +45,9 @@ class Worker extends import_channelOwner.ChannelOwner {
});
this.once(import_events.Events.Worker.Close, () => this._closedScope.close(this._page?._closeErrorWithReason() || new import_errors.TargetClosedError()));
}
static fromNullable(worker) {
return worker ? Worker.from(worker) : null;
}
static from(worker) {
return worker._object;
}
@@ -56,6 +64,20 @@ class Worker extends import_channelOwner.ChannelOwner {
const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
return import_jsHandle.JSHandle.from(result.handle);
}
async waitForEvent(event, optionsOrPredicate = {}) {
return await this._wrapApiCall(async () => {
const timeoutSettings = this._page?._timeoutSettings ?? this._context?._timeoutSettings ?? new import_timeoutSettings.TimeoutSettings(this._platform);
const timeout = timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
const waiter = import_waiter.Waiter.createForEvent(this, event);
waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
if (event !== import_events.Events.Worker.Close)
waiter.rejectOnEvent(this, import_events.Events.Worker.Close, () => new import_errors.TargetClosedError());
const result = await waiter.waitForEvent(this, event, predicate);
waiter.dispose();
return result;
});
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {

0
node_modules/playwright-core/lib/client/writableStream.js generated vendored Normal file → Executable file
View File