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

@@ -4,7 +4,7 @@ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
- agent-base@6.0.2 (https://github.com/TooTallNate/node-agent-base)
- agent-base@7.1.4 (https://github.com/TooTallNate/proxy-agents)
- balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match)
- brace-expansion@1.1.12 (https://github.com/juliangruber/brace-expansion)
- buffer-crc32@0.2.13 (https://github.com/brianloveswords/buffer-crc32)
@@ -20,7 +20,7 @@ This project incorporates components from the projects listed below. The origina
- end-of-stream@1.4.4 (https://github.com/mafintosh/end-of-stream)
- get-stream@5.2.0 (https://github.com/sindresorhus/get-stream)
- graceful-fs@4.2.10 (https://github.com/isaacs/node-graceful-fs)
- https-proxy-agent@5.0.1 (https://github.com/TooTallNate/node-https-proxy-agent)
- https-proxy-agent@7.0.6 (https://github.com/TooTallNate/proxy-agents)
- ip-address@9.0.5 (https://github.com/beaugunderson/ip-address)
- is-docker@2.2.1 (https://github.com/sindresorhus/is-docker)
- is-wsl@2.2.0 (https://github.com/sindresorhus/is-wsl)
@@ -40,7 +40,7 @@ This project incorporates components from the projects listed below. The origina
- retry@0.12.0 (https://github.com/tim-kos/node-retry)
- signal-exit@3.0.7 (https://github.com/tapjs/signal-exit)
- smart-buffer@4.2.0 (https://github.com/JoshGlazebrook/smart-buffer)
- socks-proxy-agent@6.1.1 (https://github.com/TooTallNate/node-socks-proxy-agent)
- socks-proxy-agent@8.0.5 (https://github.com/TooTallNate/proxy-agents)
- socks@2.8.3 (https://github.com/JoshGlazebrook/socks)
- sprintf-js@1.1.3 (https://github.com/alexei/sprintf.js)
- wrappy@1.0.2 (https://github.com/npm/wrappy)
@@ -48,129 +48,13 @@ This project incorporates components from the projects listed below. The origina
- yaml@2.6.0 (https://github.com/eemeli/yaml)
- yauzl@3.2.0 (https://github.com/thejoshwolfe/yauzl)
- yazl@2.5.1 (https://github.com/thejoshwolfe/yazl)
- zod@3.25.76 (https://github.com/colinhacks/zod)
%% agent-base@6.0.2 NOTICES AND INFORMATION BEGIN HERE
%% agent-base@7.1.4 NOTICES AND INFORMATION BEGIN HERE
=========================================
agent-base
==========
### Turn a function into an [`http.Agent`][http.Agent] instance
[![Build Status](https://github.com/TooTallNate/node-agent-base/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-agent-base/actions?workflow=Node+CI)
This module provides an `http.Agent` generator. That is, you pass it an async
callback function, and it returns a new `http.Agent` instance that will invoke the
given callback function when sending outbound HTTP requests.
#### Some subclasses:
Here's some more interesting uses of `agent-base`.
Send a pull request to list yours!
* [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints
* [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints
* [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS
* [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS
Installation
------------
Install with `npm`:
``` bash
$ npm install agent-base
```
Example
-------
Here's a minimal example that creates a new `net.Socket` connection to the server
for every HTTP request (i.e. the equivalent of `agent: false` option):
```js
var net = require('net');
var tls = require('tls');
var url = require('url');
var http = require('http');
var agent = require('agent-base');
var endpoint = 'http://nodejs.org/api/';
var parsed = url.parse(endpoint);
// This is the important part!
parsed.agent = agent(function (req, opts) {
var socket;
// `secureEndpoint` is true when using the https module
if (opts.secureEndpoint) {
socket = tls.connect(opts);
} else {
socket = net.connect(opts);
}
return socket;
});
// Everything else works just like normal...
http.get(parsed, function (res) {
console.log('"response" event!', res.headers);
res.pipe(process.stdout);
});
```
Returning a Promise or using an `async` function is also supported:
```js
agent(async function (req, opts) {
await sleep(1000);
// etc…
});
```
Return another `http.Agent` instance to "pass through" the responsibility
for that HTTP request to that agent:
```js
agent(function (req, opts) {
return opts.secureEndpoint ? https.globalAgent : http.globalAgent;
});
```
API
---
## Agent(Function callback[, Object options]) → [http.Agent][]
Creates a base `http.Agent` that will execute the callback function `callback`
for every HTTP request that it is used as the `agent` for. The callback function
is responsible for creating a `stream.Duplex` instance of some kind that will be
used as the underlying socket in the HTTP request.
The `options` object accepts the following properties:
* `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional).
The callback function should have the following signature:
### callback(http.ClientRequest req, Object options, Function cb) → undefined
The ClientRequest `req` can be accessed to read request headers and
and the path, etc. The `options` object contains the options passed
to the `http.request()`/`https.request()` function call, and is formatted
to be directly passed to `net.connect()`/`tls.connect()`, or however
else you want a Socket to be created. Pass the created socket to
the callback function `cb` once created, and the HTTP request will
continue to proceed.
If the `https` module is used to invoke the HTTP request, then the
`secureEndpoint` property on `options` _will be set to `true`_.
License
-------
(The MIT License)
Copyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -190,14 +74,8 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent
[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent
[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent
=========================================
END OF agent-base@6.0.2 AND INFORMATION
END OF agent-base@7.1.4 AND INFORMATION
%% balanced-match@1.0.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
@@ -565,124 +443,11 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF graceful-fs@4.2.10 AND INFORMATION
%% https-proxy-agent@5.0.1 NOTICES AND INFORMATION BEGIN HERE
%% https-proxy-agent@7.0.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
https-proxy-agent
================
### An HTTP(s) proxy `http.Agent` implementation for HTTPS
[![Build Status](https://github.com/TooTallNate/node-https-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-https-proxy-agent/actions?workflow=Node+CI)
This module provides an `http.Agent` implementation that connects to a specified
HTTP or HTTPS proxy server, and can be used with the built-in `https` module.
Specifically, this `Agent` implementation connects to an intermediary "proxy"
server and issues the [CONNECT HTTP method][CONNECT], which tells the proxy to
open a direct TCP connection to the destination server.
Since this agent implements the CONNECT HTTP method, it also works with other
protocols that use this method when connecting over proxies (i.e. WebSockets).
See the "Examples" section below for more.
Installation
------------
Install with `npm`:
``` bash
$ npm install https-proxy-agent
```
Examples
--------
#### `https` module example
``` js
var url = require('url');
var https = require('https');
var HttpsProxyAgent = require('https-proxy-agent');
// HTTP/HTTPS proxy to connect to
var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
console.log('using proxy server %j', proxy);
// HTTPS endpoint for the proxy to connect to
var endpoint = process.argv[2] || 'https://graph.facebook.com/tootallnate';
console.log('attempting to GET %j', endpoint);
var options = url.parse(endpoint);
// create an instance of the `HttpsProxyAgent` class with the proxy server information
var agent = new HttpsProxyAgent(proxy);
options.agent = agent;
https.get(options, function (res) {
console.log('"response" event!', res.headers);
res.pipe(process.stdout);
});
```
#### `ws` WebSocket connection example
``` js
var url = require('url');
var WebSocket = require('ws');
var HttpsProxyAgent = require('https-proxy-agent');
// HTTP/HTTPS proxy to connect to
var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
console.log('using proxy server %j', proxy);
// WebSocket endpoint for the proxy to connect to
var endpoint = process.argv[2] || 'ws://echo.websocket.org';
var parsed = url.parse(endpoint);
console.log('attempting to connect to WebSocket %j', endpoint);
// create an instance of the `HttpsProxyAgent` class with the proxy server information
var options = url.parse(proxy);
var agent = new HttpsProxyAgent(options);
// finally, initiate the WebSocket connection
var socket = new WebSocket(endpoint, { agent: agent });
socket.on('open', function () {
console.log('"open" event!');
socket.send('hello world');
});
socket.on('message', function (data, flags) {
console.log('"message" event! %j %j', data, flags);
socket.close();
});
```
API
---
### new HttpsProxyAgent(Object options)
The `HttpsProxyAgent` class implements an `http.Agent` subclass that connects
to the specified "HTTP(s) proxy server" in order to proxy HTTPS and/or WebSocket
requests. This is achieved by using the [HTTP `CONNECT` method][CONNECT].
The `options` argument may either be a string URI of the proxy server to use, or an
"options" object with more specific properties:
* `host` - String - Proxy host to connect to (may use `hostname` as well). Required.
* `port` - Number - Proxy port to connect to. Required.
* `protocol` - String - If `https:`, then use TLS to connect to the proxy.
* `headers` - Object - Additional HTTP headers to be sent on the HTTP CONNECT method.
* Any other options given are passed to the `net.connect()`/`tls.connect()` functions.
License
-------
(The MIT License)
Copyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -702,10 +467,8 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[CONNECT]: http://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_Tunneling
=========================================
END OF https-proxy-agent@5.0.1 AND INFORMATION
END OF https-proxy-agent@7.0.6 AND INFORMATION
%% ip-address@9.0.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
@@ -1169,141 +932,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF smart-buffer@4.2.0 AND INFORMATION
%% socks-proxy-agent@6.1.1 NOTICES AND INFORMATION BEGIN HERE
%% socks-proxy-agent@8.0.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
socks-proxy-agent
================
### A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS
[![Build Status](https://github.com/TooTallNate/node-socks-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-socks-proxy-agent/actions?workflow=Node+CI)
This module provides an `http.Agent` implementation that connects to a
specified SOCKS proxy server, and can be used with the built-in `http`
and `https` modules.
It can also be used in conjunction with the `ws` module to establish a WebSocket
connection over a SOCKS proxy. See the "Examples" section below.
Installation
------------
Install with `npm`:
``` bash
$ npm install socks-proxy-agent
```
Examples
--------
#### TypeScript example
```ts
import https from 'https';
import { SocksProxyAgent } from 'socks-proxy-agent';
const info = {
host: 'br41.nordvpn.com',
userId: 'your-name@gmail.com',
password: 'abcdef12345124'
};
const agent = new SocksProxyAgent(info);
https.get('https://jsonip.org', { agent }, (res) => {
console.log(res.headers);
res.pipe(process.stdout);
});
```
#### `http` module example
```js
var url = require('url');
var http = require('http');
var SocksProxyAgent = require('socks-proxy-agent');
// SOCKS proxy to connect to
var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080';
console.log('using proxy server %j', proxy);
// HTTP endpoint for the proxy to connect to
var endpoint = process.argv[2] || 'http://nodejs.org/api/';
console.log('attempting to GET %j', endpoint);
var opts = url.parse(endpoint);
// create an instance of the `SocksProxyAgent` class with the proxy server information
var agent = new SocksProxyAgent(proxy);
opts.agent = agent;
http.get(opts, function (res) {
console.log('"response" event!', res.headers);
res.pipe(process.stdout);
});
```
#### `https` module example
```js
var url = require('url');
var https = require('https');
var SocksProxyAgent = require('socks-proxy-agent');
// SOCKS proxy to connect to
var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080';
console.log('using proxy server %j', proxy);
// HTTP endpoint for the proxy to connect to
var endpoint = process.argv[2] || 'https://encrypted.google.com/';
console.log('attempting to GET %j', endpoint);
var opts = url.parse(endpoint);
// create an instance of the `SocksProxyAgent` class with the proxy server information
var agent = new SocksProxyAgent(proxy);
opts.agent = agent;
https.get(opts, function (res) {
console.log('"response" event!', res.headers);
res.pipe(process.stdout);
});
```
#### `ws` WebSocket connection example
``` js
var WebSocket = require('ws');
var SocksProxyAgent = require('socks-proxy-agent');
// SOCKS proxy to connect to
var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080';
console.log('using proxy server %j', proxy);
// WebSocket endpoint for the proxy to connect to
var endpoint = process.argv[2] || 'ws://echo.websocket.org';
console.log('attempting to connect to WebSocket %j', endpoint);
// create an instance of the `SocksProxyAgent` class with the proxy server information
var agent = new SocksProxyAgent(proxy);
// initiate the WebSocket connection
var socket = new WebSocket(endpoint, { agent: agent });
socket.on('open', function () {
console.log('"open" event!');
socket.send('hello world');
});
socket.on('message', function (data, flags) {
console.log('"message" event! %j %j', data, flags);
socket.close();
});
```
License
-------
(The MIT License)
Copyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -1324,7 +957,7 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF socks-proxy-agent@6.1.1 AND INFORMATION
END OF socks-proxy-agent@8.0.5 AND INFORMATION
%% socks@2.8.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
@@ -1495,8 +1128,34 @@ SOFTWARE.
=========================================
END OF yazl@2.5.1 AND INFORMATION
%% zod@3.25.76 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) 2025 Colin McDonnell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF zod@3.25.76 AND INFORMATION
SUMMARY BEGIN HERE
=========================================
Total Packages: 44
Total Packages: 45
=========================================
END OF SUMMARY

0
node_modules/playwright-core/bin/install_media_pack.ps1 generated vendored Normal file → Executable file
View File

4
node_modules/playwright-core/bin/install_webkit_wsl.ps1 generated vendored Normal file → Executable file
View File

@@ -1,7 +1,5 @@
$ErrorActionPreference = 'Stop'
# WebKit WSL Installation Script
# See webkit-wsl-transport-server.ts for the complete architecture diagram.
# This script sets up a WSL distribution that will be used to run WebKit.
$Distribution = "playwright"
@@ -25,9 +23,9 @@ if [ ! -f "/home/$Username/node/bin/node" ]; then
mkdir -p /home/$Username/node
curl -fsSL https://nodejs.org/dist/v22.17.0/node-v22.17.0-linux-x64.tar.xz -o /home/$Username/node/node-v22.17.0-linux-x64.tar.xz
tar -xJf /home/$Username/node/node-v22.17.0-linux-x64.tar.xz -C /home/$Username/node --strip-components=1
sudo -u $Username echo 'export PATH=/home/$Username/node/bin:\`$PATH' >> /home/$Username/.profile
fi
/home/$Username/node/bin/node cli.js install-deps webkit
cp lib/server/webkit/wsl/webkit-wsl-transport-client.js /home/$Username/
sudo -u $Username PLAYWRIGHT_SKIP_BROWSER_GC=1 /home/$Username/node/bin/node cli.js install webkit
"@ -replace "\r\n", "`n"

0
node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 generated vendored Normal file → Executable file
View File

View File

@@ -3,43 +3,43 @@
"browsers": [
{
"name": "chromium",
"revision": "1194",
"revision": "1200",
"installByDefault": true,
"browserVersion": "141.0.7390.37"
"browserVersion": "143.0.7499.4"
},
{
"name": "chromium-headless-shell",
"revision": "1194",
"revision": "1200",
"installByDefault": true,
"browserVersion": "141.0.7390.37"
"browserVersion": "143.0.7499.4"
},
{
"name": "chromium-tip-of-tree",
"revision": "1371",
"revision": "1380",
"installByDefault": false,
"browserVersion": "142.0.7430.0"
"browserVersion": "143.0.7488.0"
},
{
"name": "chromium-tip-of-tree-headless-shell",
"revision": "1371",
"revision": "1380",
"installByDefault": false,
"browserVersion": "142.0.7430.0"
"browserVersion": "143.0.7488.0"
},
{
"name": "firefox",
"revision": "1495",
"revision": "1497",
"installByDefault": true,
"browserVersion": "142.0.1"
"browserVersion": "144.0.2"
},
{
"name": "firefox-beta",
"revision": "1490",
"revision": "1493",
"installByDefault": false,
"browserVersion": "143.0b10"
"browserVersion": "145.0b10"
},
{
"name": "webkit",
"revision": "2215",
"revision": "2227",
"installByDefault": true,
"revisionOverrides": {
"debian11-x64": "2105",

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

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

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

71
node_modules/playwright-core/lib/cli/program.js generated vendored Normal file → Executable file
View File

@@ -72,47 +72,6 @@ Examples:
$ codegen
$ codegen --target=python
$ codegen -b webkit https://example.com`);
function suggestedBrowsersToInstall() {
return import_server.registry.executables().filter((e) => e.installType !== "none" && e.type !== "tool").map((e) => e.name).join(", ");
}
function defaultBrowsersToInstall(options) {
let executables = import_server.registry.defaultExecutables();
if (options.noShell)
executables = executables.filter((e) => e.name !== "chromium-headless-shell");
if (options.onlyShell)
executables = executables.filter((e) => e.name !== "chromium");
return executables;
}
function checkBrowsersToInstall(args, options) {
if (options.noShell && options.onlyShell)
throw new Error(`Only one of --no-shell and --only-shell can be specified`);
const faultyArguments = [];
const executables = [];
const handleArgument = (arg) => {
const executable = import_server.registry.findExecutable(arg);
if (!executable || executable.installType === "none")
faultyArguments.push(arg);
else
executables.push(executable);
if (executable?.browserName === "chromium")
executables.push(import_server.registry.findExecutable("ffmpeg"));
};
for (const arg of args) {
if (arg === "chromium") {
if (!options.onlyShell)
handleArgument("chromium");
if (!options.noShell)
handleArgument("chromium-headless-shell");
} else {
handleArgument(arg);
}
}
if (process.platform === "win32")
executables.push(import_server.registry.findExecutable("winldd"));
if (faultyArguments.length)
throw new Error(`Invalid installation targets: ${faultyArguments.map((name) => `'${name}'`).join(", ")}. Expecting one of: ${suggestedBrowsersToInstall()}`);
return executables;
}
function printInstalledBrowsers(browsers2) {
const browserPaths = /* @__PURE__ */ new Set();
for (const browser of browsers2)
@@ -166,8 +125,6 @@ Playwright version: ${version}`);
}
}
import_utilsBundle.program.command("install [browser...]").description("ensure browsers necessary for this version of Playwright are installed").option("--with-deps", "install system dependencies for browsers").option("--dry-run", "do not execute installation, only print information").option("--list", "prints list of browsers from all playwright installations").option("--force", "force reinstall of stable browser channels").option("--only-shell", "only install headless shell when installing chromium").option("--no-shell", "do not install chromium headless shell").action(async function(args, options) {
if (options.shell === false)
options.noShell = true;
if ((0, import_utils.isLikelyNpxGlobal)()) {
console.error((0, import_ascii.wrapInASCIIBox)([
`WARNING: It looks like you are running 'npx playwright install' without first`,
@@ -189,8 +146,10 @@ import_utilsBundle.program.command("install [browser...]").description("ensure b
].join("\n"), 1));
}
try {
const hasNoArguments = !args.length;
const executables = hasNoArguments ? defaultBrowsersToInstall(options) : checkBrowsersToInstall(args, options);
if (options.shell === false && options.onlyShell)
throw new Error(`Only one of --no-shell and --only-shell can be specified`);
const shell = options.shell === false ? "no" : options.onlyShell ? "only" : void 0;
const executables = import_server.registry.resolveBrowsers(args, { shell });
if (options.withDeps)
await import_server.registry.installDeps(executables, !!options.dryRun);
if (options.dryRun && options.list)
@@ -212,8 +171,8 @@ import_utilsBundle.program.command("install [browser...]").description("ensure b
const browsers2 = await import_server.registry.listInstalledBrowsers();
printGroupedByPlaywrightVersion(browsers2);
} else {
const forceReinstall = hasNoArguments ? false : !!options.force;
await import_server.registry.install(executables, forceReinstall);
const force = args.length === 0 ? false : !!options.force;
await import_server.registry.install(executables, { force });
await import_server.registry.validateHostRequirementsForExecutablesIfNeeded(executables, process.env.PW_LANG_NAME || "javascript").catch((e) => {
e.name = "Playwright Host validation warning";
console.error(e);
@@ -231,7 +190,7 @@ Examples:
Install default browsers.
- $ install chrome firefox
Install custom browsers, supports ${suggestedBrowsersToInstall()}.`);
Install custom browsers, supports ${import_server.registry.suggestedBrowsersToInstall()}.`);
import_utilsBundle.program.command("uninstall").description("Removes browsers used by this installation of Playwright from the system (chromium, firefox, webkit, ffmpeg). This does not include branded channels.").option("--all", "Removes all browsers used by any Playwright installation from the system.").action(async (options) => {
delete process.env.PLAYWRIGHT_SKIP_BROWSER_GC;
await import_server.registry.uninstall(!!options.all).then(({ numberOfBrowsersLeft }) => {
@@ -244,10 +203,7 @@ To uninstall Playwright browsers for all installations, re-run with --all flag.`
});
import_utilsBundle.program.command("install-deps [browser...]").description("install dependencies necessary to run browsers (will ask for sudo permissions)").option("--dry-run", "Do not execute installation commands, only print them").action(async function(args, options) {
try {
if (!args.length)
await import_server.registry.installDeps(defaultBrowsersToInstall({}), !!options.dryRun);
else
await import_server.registry.installDeps(checkBrowsersToInstall(args, {}), !!options.dryRun);
await import_server.registry.installDeps(import_server.registry.resolveBrowsers(args, {}), !!options.dryRun);
} catch (e) {
console.log(`Failed to install browser dependencies
${e}`);
@@ -259,7 +215,7 @@ Examples:
Install dependencies for default browsers.
- $ install-deps chrome firefox
Install dependencies for specific browsers, supports ${suggestedBrowsersToInstall()}.`);
Install dependencies for specific browsers, supports ${import_server.registry.suggestedBrowsersToInstall()}.`);
const browsers = [
{ alias: "cr", name: "Chromium", type: "chromium" },
{ alias: "ff", name: "Firefox", type: "firefox" },
@@ -304,7 +260,7 @@ Examples:
import_utilsBundle.program.command("run-driver", { hidden: true }).action(function(options) {
(0, import_driver.runDriver)();
});
import_utilsBundle.program.command("run-server").option("--port <port>", "Server port").option("--host <host>", "Server host").option("--path <path>", "Endpoint Path", "/").option("--max-clients <maxClients>", "Maximum clients").option("--mode <mode>", 'Server mode, either "default" or "extension"').action(function(options) {
import_utilsBundle.program.command("run-server", { hidden: true }).option("--port <port>", "Server port").option("--host <host>", "Server host").option("--path <path>", "Endpoint Path", "/").option("--max-clients <maxClients>", "Maximum clients").option("--mode <mode>", 'Server mode, either "default" or "extension"').action(function(options) {
(0, import_driver.runServer)({
port: options.port ? +options.port : void 0,
host: options.host,
@@ -319,7 +275,7 @@ import_utilsBundle.program.command("print-api-json", { hidden: true }).action(fu
import_utilsBundle.program.command("launch-server", { hidden: true }).requiredOption("--browser <browserName>", 'Browser name, one of "chromium", "firefox" or "webkit"').option("--config <path-to-config-file>", "JSON file with launchServer options").action(function(options) {
(0, import_driver.launchBrowserServer)(options.browser, options.config);
});
import_utilsBundle.program.command("show-trace [trace...]").option("-b, --browser <browserType>", "browser to use, one of cr, chromium, ff, firefox, wk, webkit", "chromium").option("-h, --host <host>", "Host to serve trace on; specifying this option opens trace in a browser tab").option("-p, --port <port>", "Port to serve trace on, 0 for any free port; specifying this option opens trace in a browser tab").option("--stdin", "Accept trace URLs over stdin to update the viewer").description("show trace viewer").action(function(traces, options) {
import_utilsBundle.program.command("show-trace [trace]").option("-b, --browser <browserType>", "browser to use, one of cr, chromium, ff, firefox, wk, webkit", "chromium").option("-h, --host <host>", "Host to serve trace on; specifying this option opens trace in a browser tab").option("-p, --port <port>", "Port to serve trace on, 0 for any free port; specifying this option opens trace in a browser tab").option("--stdin", "Accept trace URLs over stdin to update the viewer").description("show trace viewer").action(function(trace, options) {
if (options.browser === "cr")
options.browser = "chromium";
if (options.browser === "ff")
@@ -332,12 +288,13 @@ import_utilsBundle.program.command("show-trace [trace...]").option("-b, --browse
isServer: !!options.stdin
};
if (options.port !== void 0 || options.host !== void 0)
(0, import_traceViewer.runTraceInBrowser)(traces, openOptions).catch(logErrorAndExit);
(0, import_traceViewer.runTraceInBrowser)(trace, openOptions).catch(logErrorAndExit);
else
(0, import_traceViewer.runTraceViewerApp)(traces, options.browser, openOptions, true).catch(logErrorAndExit);
(0, import_traceViewer.runTraceViewerApp)(trace, options.browser, openOptions, true).catch(logErrorAndExit);
}).addHelpText("afterAll", `
Examples:
$ show-trace
$ show-trace https://example.com/trace.zip`);
async function launchContext(options, extraOptions) {
validateOptions(options);

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

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

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

2
node_modules/playwright-core/lib/generated/clockSource.js generated vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

2
node_modules/playwright-core/lib/generated/injectedScriptSource.js generated vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

2
node_modules/playwright-core/lib/generated/pollingRecorderSource.js generated vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

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

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

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

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

@@ -43,8 +43,6 @@ function createInProcessPlaywright() {
playwrightAPI.firefox._serverLauncher = new import_browserServerImpl.BrowserServerLauncherImpl("firefox");
playwrightAPI.webkit._serverLauncher = new import_browserServerImpl.BrowserServerLauncherImpl("webkit");
playwrightAPI._android._serverLauncher = new import_androidServerImpl.AndroidServerLauncherImpl();
playwrightAPI._bidiChromium._serverLauncher = new import_browserServerImpl.BrowserServerLauncherImpl("_bidiChromium");
playwrightAPI._bidiFirefox._serverLauncher = new import_browserServerImpl.BrowserServerLauncherImpl("_bidiFirefox");
dispatcherConnection.onmessage = (message) => setImmediate(() => clientConnection.dispatch(message));
clientConnection.onmessage = (message) => setImmediate(() => dispatcherConnection.dispatch(message));
clientConnection.toImpl = (x) => {

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

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

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

70
node_modules/playwright-core/lib/protocol/validator.js generated vendored Normal file → Executable file
View File

@@ -103,35 +103,6 @@ import_validatorPrimitives.scheme.SelectorEngine = (0, import_validatorPrimitive
source: import_validatorPrimitives.tString,
contentScript: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean)
});
import_validatorPrimitives.scheme.AXNode = (0, import_validatorPrimitives.tObject)({
role: import_validatorPrimitives.tString,
name: import_validatorPrimitives.tString,
valueString: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
valueNumber: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tFloat),
description: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
keyshortcuts: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
roledescription: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
valuetext: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
disabled: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
expanded: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
focused: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
modal: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
multiline: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
multiselectable: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
readonly: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
required: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
selected: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
checked: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tEnum)(["checked", "unchecked", "mixed"])),
pressed: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tEnum)(["pressed", "released", "mixed"])),
level: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
valuemin: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tFloat),
valuemax: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tFloat),
autocomplete: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
haspopup: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
invalid: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
orientation: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
children: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tArray)((0, import_validatorPrimitives.tType)("AXNode")))
});
import_validatorPrimitives.scheme.SetNetworkCookie = (0, import_validatorPrimitives.tObject)({
name: import_validatorPrimitives.tString,
value: import_validatorPrimitives.tString,
@@ -351,7 +322,8 @@ import_validatorPrimitives.scheme.LocalUtilsConnectResult = (0, import_validator
});
import_validatorPrimitives.scheme.LocalUtilsTracingStartedParams = (0, import_validatorPrimitives.tObject)({
tracesDir: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
traceName: import_validatorPrimitives.tString
traceName: import_validatorPrimitives.tString,
live: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean)
});
import_validatorPrimitives.scheme.LocalUtilsTracingStartedResult = (0, import_validatorPrimitives.tObject)({
stacksId: import_validatorPrimitives.tString
@@ -383,8 +355,6 @@ import_validatorPrimitives.scheme.PlaywrightInitializer = (0, import_validatorPr
chromium: (0, import_validatorPrimitives.tChannel)(["BrowserType"]),
firefox: (0, import_validatorPrimitives.tChannel)(["BrowserType"]),
webkit: (0, import_validatorPrimitives.tChannel)(["BrowserType"]),
_bidiChromium: (0, import_validatorPrimitives.tChannel)(["BrowserType"]),
_bidiFirefox: (0, import_validatorPrimitives.tChannel)(["BrowserType"]),
android: (0, import_validatorPrimitives.tChannel)(["Android"]),
electron: (0, import_validatorPrimitives.tChannel)(["Electron"]),
utils: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tChannel)(["LocalUtils"])),
@@ -847,12 +817,14 @@ import_validatorPrimitives.scheme.EventTargetWaitForEventInfoParams = (0, import
});
import_validatorPrimitives.scheme.BrowserContextWaitForEventInfoParams = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoParams");
import_validatorPrimitives.scheme.PageWaitForEventInfoParams = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoParams");
import_validatorPrimitives.scheme.WorkerWaitForEventInfoParams = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoParams");
import_validatorPrimitives.scheme.WebSocketWaitForEventInfoParams = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoParams");
import_validatorPrimitives.scheme.ElectronApplicationWaitForEventInfoParams = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoParams");
import_validatorPrimitives.scheme.AndroidDeviceWaitForEventInfoParams = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoParams");
import_validatorPrimitives.scheme.EventTargetWaitForEventInfoResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
import_validatorPrimitives.scheme.BrowserContextWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
import_validatorPrimitives.scheme.PageWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
import_validatorPrimitives.scheme.WorkerWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
import_validatorPrimitives.scheme.WebSocketWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
import_validatorPrimitives.scheme.ElectronApplicationWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
import_validatorPrimitives.scheme.AndroidDeviceWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
@@ -931,7 +903,8 @@ import_validatorPrimitives.scheme.BrowserContextConsoleEvent = (0, import_valida
lineNumber: import_validatorPrimitives.tInt,
columnNumber: import_validatorPrimitives.tInt
}),
page: (0, import_validatorPrimitives.tChannel)(["Page"])
page: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tChannel)(["Page"])),
worker: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tChannel)(["Worker"]))
});
import_validatorPrimitives.scheme.BrowserContextCloseEvent = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
import_validatorPrimitives.scheme.BrowserContextDialogEvent = (0, import_validatorPrimitives.tObject)({
@@ -1433,13 +1406,6 @@ import_validatorPrimitives.scheme.PageTouchscreenTapParams = (0, import_validato
y: import_validatorPrimitives.tFloat
});
import_validatorPrimitives.scheme.PageTouchscreenTapResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
import_validatorPrimitives.scheme.PageAccessibilitySnapshotParams = (0, import_validatorPrimitives.tObject)({
interestingOnly: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
root: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tChannel)(["ElementHandle"]))
});
import_validatorPrimitives.scheme.PageAccessibilitySnapshotResult = (0, import_validatorPrimitives.tObject)({
rootAXNode: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tType)("AXNode"))
});
import_validatorPrimitives.scheme.PagePageErrorsParams = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
import_validatorPrimitives.scheme.PagePageErrorsResult = (0, import_validatorPrimitives.tObject)({
errors: (0, import_validatorPrimitives.tArray)((0, import_validatorPrimitives.tType)("SerializedError"))
@@ -1473,10 +1439,12 @@ import_validatorPrimitives.scheme.PageRequestsResult = (0, import_validatorPrimi
requests: (0, import_validatorPrimitives.tArray)((0, import_validatorPrimitives.tChannel)(["Request"]))
});
import_validatorPrimitives.scheme.PageSnapshotForAIParams = (0, import_validatorPrimitives.tObject)({
track: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
timeout: import_validatorPrimitives.tFloat
});
import_validatorPrimitives.scheme.PageSnapshotForAIResult = (0, import_validatorPrimitives.tObject)({
snapshot: import_validatorPrimitives.tString
full: import_validatorPrimitives.tString,
incremental: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString)
});
import_validatorPrimitives.scheme.PageStartJSCoverageParams = (0, import_validatorPrimitives.tObject)({
resetOnNavigation: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
@@ -1607,7 +1575,8 @@ import_validatorPrimitives.scheme.FrameClickParams = (0, import_validatorPrimiti
button: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tEnum)(["left", "right", "middle"])),
clickCount: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
timeout: import_validatorPrimitives.tFloat,
trial: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean)
trial: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
steps: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt)
});
import_validatorPrimitives.scheme.FrameClickResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
import_validatorPrimitives.scheme.FrameContentParams = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
@@ -1622,7 +1591,8 @@ import_validatorPrimitives.scheme.FrameDragAndDropParams = (0, import_validatorP
trial: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
sourcePosition: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tType)("Point")),
targetPosition: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tType)("Point")),
strict: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean)
strict: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
steps: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt)
});
import_validatorPrimitives.scheme.FrameDragAndDropResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
import_validatorPrimitives.scheme.FrameDblclickParams = (0, import_validatorPrimitives.tObject)({
@@ -1634,7 +1604,8 @@ import_validatorPrimitives.scheme.FrameDblclickParams = (0, import_validatorPrim
delay: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tFloat),
button: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tEnum)(["left", "right", "middle"])),
timeout: import_validatorPrimitives.tFloat,
trial: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean)
trial: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
steps: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt)
});
import_validatorPrimitives.scheme.FrameDblclickResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
import_validatorPrimitives.scheme.FrameDispatchEventParams = (0, import_validatorPrimitives.tObject)({
@@ -1953,6 +1924,11 @@ import_validatorPrimitives.scheme.WorkerEvaluateExpressionHandleParams = (0, imp
import_validatorPrimitives.scheme.WorkerEvaluateExpressionHandleResult = (0, import_validatorPrimitives.tObject)({
handle: (0, import_validatorPrimitives.tChannel)(["ElementHandle", "JSHandle"])
});
import_validatorPrimitives.scheme.WorkerUpdateSubscriptionParams = (0, import_validatorPrimitives.tObject)({
event: (0, import_validatorPrimitives.tEnum)(["console"]),
enabled: import_validatorPrimitives.tBoolean
});
import_validatorPrimitives.scheme.WorkerUpdateSubscriptionResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
import_validatorPrimitives.scheme.JSHandleInitializer = (0, import_validatorPrimitives.tObject)({
preview: import_validatorPrimitives.tString
});
@@ -2049,7 +2025,8 @@ import_validatorPrimitives.scheme.ElementHandleClickParams = (0, import_validato
button: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tEnum)(["left", "right", "middle"])),
clickCount: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
timeout: import_validatorPrimitives.tFloat,
trial: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean)
trial: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
steps: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt)
});
import_validatorPrimitives.scheme.ElementHandleClickResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
import_validatorPrimitives.scheme.ElementHandleContentFrameParams = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
@@ -2063,7 +2040,8 @@ import_validatorPrimitives.scheme.ElementHandleDblclickParams = (0, import_valid
delay: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tFloat),
button: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tEnum)(["left", "right", "middle"])),
timeout: import_validatorPrimitives.tFloat,
trial: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean)
trial: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
steps: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt)
});
import_validatorPrimitives.scheme.ElementHandleDblclickResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
import_validatorPrimitives.scheme.ElementHandleDispatchEventParams = (0, import_validatorPrimitives.tObject)({

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

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

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

View File

@@ -1,69 +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);
class Accessibility {
constructor(getAXTree) {
this._getAXTree = getAXTree;
}
async snapshot(options = {}) {
const {
interestingOnly = true,
root = null
} = options;
const { tree, needle } = await this._getAXTree(root || void 0);
if (!interestingOnly) {
if (root)
return needle && serializeTree(needle)[0];
return serializeTree(tree)[0];
}
const interestingNodes = /* @__PURE__ */ new Set();
collectInterestingNodes(interestingNodes, tree, false);
if (root && (!needle || !interestingNodes.has(needle)))
return null;
return serializeTree(needle || tree, interestingNodes)[0];
}
}
function collectInterestingNodes(collection, node, insideControl) {
if (node.isInteresting(insideControl))
collection.add(node);
if (node.isLeafNode())
return;
insideControl = insideControl || node.isControl();
for (const child of node.children())
collectInterestingNodes(collection, child, insideControl);
}
function serializeTree(node, whitelistedNodes) {
const children = [];
for (const child of node.children())
children.push(...serializeTree(child, whitelistedNodes));
if (whitelistedNodes && !whitelistedNodes.has(node))
return children;
const serializedNode = node.serialize();
if (children.length)
serializedNode.children = children;
return [serializedNode];
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Accessibility
});

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

@@ -248,7 +248,7 @@ class AndroidDevice extends import_instrumentation.SdkObject {
"--disable-fre",
"--no-default-browser-check",
`--remote-debugging-socket-name=${socketName}`,
...(0, import_chromiumSwitches.chromiumSwitches)(),
...(0, import_chromiumSwitches.chromiumSwitches)(void 0, void 0, true),
...this._innerDefaultArgs(options)
];
return chromeArguments;

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

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

37
node_modules/playwright-core/lib/server/bidi/bidiBrowser.js generated vendored Normal file → Executable file
View File

@@ -62,12 +62,16 @@ class BidiBrowser extends import_browser.Browser {
browser._bidiSessionInfo = await browser._browserSession.send("session.new", {
capabilities: {
alwaysMatch: {
acceptInsecureCerts: options.persistent?.internalIgnoreHTTPSErrors || options.persistent?.ignoreHTTPSErrors,
proxy: getProxyConfiguration(options.originalLaunchOptions.proxyOverride ?? options.proxy),
unhandledPromptBehavior: {
"acceptInsecureCerts": options.persistent?.internalIgnoreHTTPSErrors || options.persistent?.ignoreHTTPSErrors,
"proxy": getProxyConfiguration(options.originalLaunchOptions.proxyOverride ?? options.proxy),
"unhandledPromptBehavior": {
default: bidi.Session.UserPromptHandlerType.Ignore
},
webSocketUrl: true
"webSocketUrl": true,
// Chrome with WebDriver BiDi does not support prerendering
// yet because WebDriver BiDi behavior is not specified. See
// https://github.com/w3c/webdriver-bidi/issues/321.
"goog:prerenderingDisabled": true
}
}
});
@@ -76,7 +80,8 @@ class BidiBrowser extends import_browser.Browser {
"browsingContext",
"network",
"log",
"script"
"script",
"input"
]
});
await browser._browserSession.send("network.addDataCollector", {
@@ -122,16 +127,13 @@ class BidiBrowser extends import_browser.Browser {
_onBrowsingContextCreated(event) {
if (event.parent) {
const parentFrameId = event.parent;
for (const page2 of this._bidiPages.values()) {
const parentFrame = page2._page.frameManager.frame(parentFrameId);
if (!parentFrame)
continue;
const page2 = this._findPageForFrame(parentFrameId);
if (page2) {
page2._session.addFrameBrowsingContext(event.context);
page2._page.frameManager.frameAttached(event.context, parentFrameId);
const frame = page2._page.frameManager.frame(event.context);
if (frame)
frame._url = event.url;
return;
}
return;
}
@@ -141,7 +143,7 @@ class BidiBrowser extends import_browser.Browser {
if (!context)
return;
const session = this._connection.createMainFrameBrowsingContextSession(event.context);
const opener = event.originalOpener && this._bidiPages.get(event.originalOpener);
const opener = event.originalOpener && this._findPageForFrame(event.originalOpener);
const page = new import_bidiPage.BidiPage(context, session, opener || null);
page._page.mainFrame()._url = event.url;
this._bidiPages.set(event.context, page);
@@ -171,6 +173,12 @@ class BidiBrowser extends import_browser.Browser {
return;
}
}
_findPageForFrame(frameId) {
for (const page of this._bidiPages.values()) {
if (page._page.frameManager.frame(frameId))
return page;
}
}
}
class BidiBrowserContext extends import_browserContext.BrowserContext {
constructor(browser, browserContextId, options) {
@@ -207,6 +215,8 @@ class BidiBrowserContext extends import_browserContext.BrowserContext {
userContexts: [this._userContextId()]
}));
}
if (this._options.extraHTTPHeaders)
promises.push(this.doUpdateExtraHTTPHeaders());
await Promise.all(promises);
}
possiblyUninitializedPages() {
@@ -300,6 +310,11 @@ class BidiBrowserContext extends import_browserContext.BrowserContext {
});
}
async doUpdateExtraHTTPHeaders() {
const allHeaders = this._options.extraHTTPHeaders || [];
await this._browser._browserSession.send("network.setExtraHeaders", {
headers: allHeaders.map(({ name, value }) => ({ name, value: { type: "string", value } })),
userContexts: [this._userContextId()]
});
}
async setUserAgent(userAgent) {
this._options.userAgent = userAgent;

2
node_modules/playwright-core/lib/server/bidi/bidiChromium.js generated vendored Normal file → Executable file
View File

@@ -40,7 +40,7 @@ var import_chromiumSwitches = require("../chromium/chromiumSwitches");
var import_chromium = require("../chromium/chromium");
class BidiChromium extends import_browserType.BrowserType {
constructor(parent) {
super(parent, "_bidiChromium");
super(parent, "chromium");
}
async connectToTransport(transport, options, browserLogsCollector) {
const bidiTransport = await require("./bidiOverCdp").connectBidiOverCdp(transport);

0
node_modules/playwright-core/lib/server/bidi/bidiConnection.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js generated vendored Normal file → Executable file
View File

2
node_modules/playwright-core/lib/server/bidi/bidiFirefox.js generated vendored Normal file → Executable file
View File

@@ -41,7 +41,7 @@ var import_firefoxPrefs = require("./third_party/firefoxPrefs");
var import_manualPromise = require("../../utils/isomorphic/manualPromise");
class BidiFirefox extends import_browserType.BrowserType {
constructor(parent) {
super(parent, "_bidiFirefox");
super(parent, "firefox");
}
executablePath() {
return "";

0
node_modules/playwright-core/lib/server/bidi/bidiInput.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js generated vendored Normal file → Executable file
View File

30
node_modules/playwright-core/lib/server/bidi/bidiPage.js generated vendored Normal file → Executable file
View File

@@ -42,6 +42,7 @@ var import_bidiInput = require("./bidiInput");
var import_bidiNetworkManager = require("./bidiNetworkManager");
var import_bidiPdf = require("./bidiPdf");
var bidi = __toESM(require("./third_party/bidiProtocol"));
var network = __toESM(require("../network"));
const UTILITY_WORLD_NAME = "__playwright_utility_world__";
const kPlaywrightBindingChannel = "playwrightChannel";
class BidiPage {
@@ -75,7 +76,8 @@ class BidiPage {
import_eventsHelper.eventsHelper.addEventListener(bidiSession, "browsingContext.downloadWillBegin", this._onDownloadWillBegin.bind(this)),
import_eventsHelper.eventsHelper.addEventListener(bidiSession, "browsingContext.downloadEnd", this._onDownloadEnded.bind(this)),
import_eventsHelper.eventsHelper.addEventListener(bidiSession, "browsingContext.userPromptOpened", this._onUserPromptOpened.bind(this)),
import_eventsHelper.eventsHelper.addEventListener(bidiSession, "log.entryAdded", this._onLogEntryAdded.bind(this))
import_eventsHelper.eventsHelper.addEventListener(bidiSession, "log.entryAdded", this._onLogEntryAdded.bind(this)),
import_eventsHelper.eventsHelper.addEventListener(bidiSession, "input.fileDialogOpened", this._onFileDialogOpened.bind(this))
];
this._initialize().then(
() => this._page.reportAsNew(this._opener?._page),
@@ -113,6 +115,7 @@ class BidiPage {
const delegate2 = new import_bidiExecutionContext.BidiExecutionContext(this._session, realmInfo);
const worker = new import_page.Worker(this._page, realmInfo.origin);
this._realmToWorkerContext.set(realmInfo.realm, worker.createExecutionContext(delegate2));
worker.workerScriptLoaded();
this._page.addWorker(realmInfo.realm, worker);
return;
}
@@ -260,7 +263,17 @@ ${params.stackTrace?.callFrames.map((f) => {
return;
const callFrame = params.stackTrace?.callFrames[0];
const location = callFrame ?? { url: "", lineNumber: 1, columnNumber: 1 };
this._page.addConsoleMessage(entry.method, entry.args.map((arg) => (0, import_bidiExecutionContext.createHandle)(context, arg)), location, params.text || void 0);
this._page.addConsoleMessage(null, entry.method, entry.args.map((arg) => (0, import_bidiExecutionContext.createHandle)(context, arg)), location, params.text || void 0);
}
async _onFileDialogOpened(params) {
if (!params.element)
return;
const frame = this._page.frameManager.frame(params.context);
if (!frame)
return;
const executionContext = await frame._mainContext();
const handle = await toBidiExecutionContext(executionContext).remoteObjectForNodeId(executionContext, { sharedId: params.element.sharedId });
await this._page._onFileChooserOpened(handle);
}
async navigateFrame(frame, url, referrer) {
const { navigation } = await this._session.send("browsingContext.navigate", {
@@ -270,6 +283,14 @@ ${params.stackTrace?.callFrames.map((f) => {
return { newDocumentId: navigation || void 0 };
}
async updateExtraHTTPHeaders() {
const allHeaders = network.mergeHeaders([
this._browserContext._options.extraHTTPHeaders,
this._page.extraHTTPHeaders()
]);
await this._session.send("network.setExtraHeaders", {
headers: allHeaders.map(({ name, value }) => ({ name, value: { type: "string", value } })),
contexts: [this._session.sessionId]
});
}
async updateEmulateMedia() {
}
@@ -379,6 +400,8 @@ ${params.stackTrace?.callFrames.map((f) => {
}
}
async setBackgroundColor(color) {
if (color)
throw new Error("Not implemented");
}
async takeScreenshot(progress, format, documentRect, viewportRect, quality, fitsViewport, scale) {
const rect = documentRect || viewportRect;
@@ -503,9 +526,6 @@ ${params.stackTrace?.callFrames.map((f) => {
const executionContext = toBidiExecutionContext(to);
return await executionContext.remoteObjectForNodeId(to, nodeId);
}
async getAccessibilityTree(needle) {
throw new Error("Method not implemented.");
}
async inputActionEpilogue() {
}
async resetForReuse(progress) {

0
node_modules/playwright-core/lib/server/bidi/bidiPdf.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/server/bidi/third_party/bidiCommands.d.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/server/bidi/third_party/bidiDeserializer.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolCore.js generated vendored Normal file → Executable file
View File

View File

0
node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js generated vendored Normal file → Executable file
View File

0
node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js generated vendored Normal file → Executable file
View File

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

Some files were not shown because too many files have changed in this diff Show More