playwright-core 1.57.0-alpha-2025-10-29 → 1.57.0-alpha-2025-10-30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-core",
3
- "version": "1.57.0-alpha-2025-10-29",
3
+ "version": "1.57.0-alpha-2025-10-30",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var import_net = __toESM(require("net"));
25
- var import_fs = __toESM(require("fs"));
26
- var import_child_process = require("child_process");
27
- (async () => {
28
- const { PW_WSL_BRIDGE_PORT: socketPort, ...childEnv } = process.env;
29
- if (!socketPort)
30
- throw new Error("PW_WSL_BRIDGE_PORT env var is not set");
31
- const [executable, ...args] = process.argv.slice(2);
32
- if (!(await import_fs.default.promises.stat(executable)).isFile())
33
- throw new Error(`Executable does not exist. Did you update Playwright recently? Make sure to run npx playwright install webkit-wsl`);
34
- const address = (() => {
35
- const res = (0, import_child_process.spawnSync)("/usr/bin/wslinfo", ["--networking-mode"], { encoding: "utf8" });
36
- if (res.error || res.status !== 0)
37
- throw new Error(`Failed to run /usr/bin/wslinfo --networking-mode: ${res.error?.message || res.stderr || res.status}`);
38
- if (res.stdout.trim() === "nat") {
39
- const ipRes = (0, import_child_process.spawnSync)("/usr/sbin/ip", ["route", "show"], { encoding: "utf8" });
40
- if (ipRes.error || ipRes.status !== 0)
41
- throw new Error(`Failed to run ip route show: ${ipRes.error?.message || ipRes.stderr || ipRes.status}`);
42
- const ip = ipRes.stdout.trim().split("\n").find((line) => line.includes("default"))?.split(" ")[2];
43
- if (!ip)
44
- throw new Error("Could not determine WSL IP address (NAT mode).");
45
- return ip;
46
- }
47
- return "127.0.0.1";
48
- })();
49
- const socket = import_net.default.createConnection(parseInt(socketPort, 10), address);
50
- socket.setNoDelay(true);
51
- await new Promise((resolve, reject) => {
52
- socket.on("connect", resolve);
53
- socket.on("error", reject);
54
- });
55
- const child = (0, import_child_process.spawn)(executable, args, {
56
- stdio: ["inherit", "inherit", "inherit", "pipe", "pipe"],
57
- env: childEnv
58
- });
59
- const [childOutput, childInput] = [child.stdio[3], child.stdio[4]];
60
- socket.pipe(childOutput);
61
- childInput.pipe(socket);
62
- socket.on("end", () => child.kill());
63
- child.on("exit", (exitCode) => {
64
- socket.end();
65
- process.exit(exitCode || 0);
66
- });
67
- await new Promise((resolve, reject) => {
68
- child.on("exit", resolve);
69
- child.on("error", reject);
70
- });
71
- })().catch((error) => {
72
- console.error("Error occurred:", error);
73
- process.exit(1);
74
- });
@@ -1,113 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var import_net = __toESM(require("net"));
25
- var import_path = __toESM(require("path"));
26
- var import_child_process = require("child_process");
27
- (async () => {
28
- const argv = process.argv.slice(2);
29
- if (!argv.length) {
30
- console.error(`Usage: node ${import_path.default.basename(__filename)} <executable> [args...]`);
31
- process.exit(1);
32
- }
33
- const parentIn = new import_net.default.Socket({ fd: 3, readable: true, writable: false });
34
- const parentOut = new import_net.default.Socket({ fd: 4, readable: false, writable: true });
35
- const server = import_net.default.createServer();
36
- let socket = null;
37
- server.on("connection", (s) => {
38
- if (socket) {
39
- log("Extra connection received, destroying.");
40
- socket.destroy();
41
- return;
42
- }
43
- socket = s;
44
- socket.setNoDelay(true);
45
- log("Client connected, wiring pipes.");
46
- socket.pipe(parentOut);
47
- parentIn.pipe(socket);
48
- socket.on("close", () => {
49
- log("Socket closed");
50
- socket = null;
51
- });
52
- });
53
- await new Promise((resolve, reject) => {
54
- server.once("error", reject);
55
- server.listen(0, () => resolve(null));
56
- });
57
- const address = server.address();
58
- if (!address || typeof address === "string") {
59
- console.error("Failed to obtain listening address");
60
- process.exit(1);
61
- }
62
- const port = address.port;
63
- log("Server listening on", port);
64
- const env = {
65
- ...process.env,
66
- // WSLENV is a colon-delimited list of environment variables that should be included when launching WSL processes from Win32 or Win32 processes from WSL
67
- WSLENV: "PW_WSL_BRIDGE_PORT",
68
- PW_WSL_BRIDGE_PORT: String(port)
69
- };
70
- let shuttingDown = false;
71
- const child = (0, import_child_process.spawn)("wsl.exe", [
72
- "-d",
73
- "playwright",
74
- "--cd",
75
- "/home/pwuser",
76
- "/home/pwuser/node/bin/node",
77
- "/home/pwuser/webkit-wsl-transport-client.js",
78
- process.env.WEBKIT_EXECUTABLE || "",
79
- ...argv
80
- ], {
81
- env,
82
- stdio: ["inherit", "inherit", "inherit"]
83
- // no fd3/fd4 here; they stay only in this wrapper
84
- });
85
- log("Spawned child pid", child.pid);
86
- child.on("close", (code, signal) => {
87
- log("Child exit", { code, signal });
88
- const exitCode = code ?? (signal ? 128 : 0);
89
- shutdown(exitCode);
90
- });
91
- child.on("error", (err) => {
92
- console.error("Child process failed to start:", err);
93
- shutdown(1);
94
- });
95
- await new Promise((resolve) => child.once("close", resolve));
96
- async function shutdown(code = 0) {
97
- if (shuttingDown)
98
- return;
99
- shuttingDown = true;
100
- server.close();
101
- parentIn.destroy();
102
- parentOut.destroy();
103
- socket?.destroy();
104
- await new Promise((resolve) => server.once("close", resolve));
105
- process.exit(code);
106
- }
107
- function log(...args) {
108
- console.error(/* @__PURE__ */ new Date(), `[${import_path.default.basename(__filename)}]`, ...args);
109
- }
110
- })().catch((error) => {
111
- console.error("Error occurred:", error);
112
- process.exit(1);
113
- });