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

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/browsers.json CHANGED
@@ -15,15 +15,15 @@
15
15
  },
16
16
  {
17
17
  "name": "chromium-tip-of-tree",
18
- "revision": "1379",
18
+ "revision": "1380",
19
19
  "installByDefault": false,
20
- "browserVersion": "143.0.7476.0"
20
+ "browserVersion": "143.0.7488.0"
21
21
  },
22
22
  {
23
23
  "name": "chromium-tip-of-tree-headless-shell",
24
- "revision": "1379",
24
+ "revision": "1380",
25
25
  "installByDefault": false,
26
- "browserVersion": "143.0.7476.0"
26
+ "browserVersion": "143.0.7488.0"
27
27
  },
28
28
  {
29
29
  "name": "firefox",
@@ -72,47 +72,6 @@ Examples:
72
72
  $ codegen
73
73
  $ codegen --target=python
74
74
  $ codegen -b webkit https://example.com`);
75
- function suggestedBrowsersToInstall() {
76
- return import_server.registry.executables().filter((e) => e.installType !== "none" && e.type !== "tool").map((e) => e.name).join(", ");
77
- }
78
- function defaultBrowsersToInstall(options) {
79
- let executables = import_server.registry.defaultExecutables();
80
- if (options.noShell)
81
- executables = executables.filter((e) => e.name !== "chromium-headless-shell");
82
- if (options.onlyShell)
83
- executables = executables.filter((e) => e.name !== "chromium");
84
- return executables;
85
- }
86
- function checkBrowsersToInstall(args, options) {
87
- if (options.noShell && options.onlyShell)
88
- throw new Error(`Only one of --no-shell and --only-shell can be specified`);
89
- const faultyArguments = [];
90
- const executables = [];
91
- const handleArgument = (arg) => {
92
- const executable = import_server.registry.findExecutable(arg);
93
- if (!executable || executable.installType === "none")
94
- faultyArguments.push(arg);
95
- else
96
- executables.push(executable);
97
- if (executable?.browserName === "chromium")
98
- executables.push(import_server.registry.findExecutable("ffmpeg"));
99
- };
100
- for (const arg of args) {
101
- if (arg === "chromium") {
102
- if (!options.onlyShell)
103
- handleArgument("chromium");
104
- if (!options.noShell)
105
- handleArgument("chromium-headless-shell");
106
- } else {
107
- handleArgument(arg);
108
- }
109
- }
110
- if (process.platform === "win32")
111
- executables.push(import_server.registry.findExecutable("winldd"));
112
- if (faultyArguments.length)
113
- throw new Error(`Invalid installation targets: ${faultyArguments.map((name) => `'${name}'`).join(", ")}. Expecting one of: ${suggestedBrowsersToInstall()}`);
114
- return executables;
115
- }
116
75
  function printInstalledBrowsers(browsers2) {
117
76
  const browserPaths = /* @__PURE__ */ new Set();
118
77
  for (const browser of browsers2)
@@ -166,8 +125,6 @@ Playwright version: ${version}`);
166
125
  }
167
126
  }
168
127
  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) {
169
- if (options.shell === false)
170
- options.noShell = true;
171
128
  if ((0, import_utils.isLikelyNpxGlobal)()) {
172
129
  console.error((0, import_ascii.wrapInASCIIBox)([
173
130
  `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
189
146
  ].join("\n"), 1));
190
147
  }
191
148
  try {
192
- const hasNoArguments = !args.length;
193
- const executables = hasNoArguments ? defaultBrowsersToInstall(options) : checkBrowsersToInstall(args, options);
149
+ if (options.shell === false && options.onlyShell)
150
+ throw new Error(`Only one of --no-shell and --only-shell can be specified`);
151
+ const shell = options.shell === false ? "no" : options.onlyShell ? "only" : void 0;
152
+ const executables = import_server.registry.resolveBrowsers(args, { shell });
194
153
  if (options.withDeps)
195
154
  await import_server.registry.installDeps(executables, !!options.dryRun);
196
155
  if (options.dryRun && options.list)
@@ -212,8 +171,8 @@ import_utilsBundle.program.command("install [browser...]").description("ensure b
212
171
  const browsers2 = await import_server.registry.listInstalledBrowsers();
213
172
  printGroupedByPlaywrightVersion(browsers2);
214
173
  } else {
215
- const forceReinstall = hasNoArguments ? false : !!options.force;
216
- await import_server.registry.install(executables, forceReinstall);
174
+ const force = args.length === 0 ? false : !!options.force;
175
+ await import_server.registry.install(executables, { force });
217
176
  await import_server.registry.validateHostRequirementsForExecutablesIfNeeded(executables, process.env.PW_LANG_NAME || "javascript").catch((e) => {
218
177
  e.name = "Playwright Host validation warning";
219
178
  console.error(e);
@@ -231,7 +190,7 @@ Examples:
231
190
  Install default browsers.
232
191
 
233
192
  - $ install chrome firefox
234
- Install custom browsers, supports ${suggestedBrowsersToInstall()}.`);
193
+ Install custom browsers, supports ${import_server.registry.suggestedBrowsersToInstall()}.`);
235
194
  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) => {
236
195
  delete process.env.PLAYWRIGHT_SKIP_BROWSER_GC;
237
196
  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.`
244
203
  });
245
204
  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) {
246
205
  try {
247
- if (!args.length)
248
- await import_server.registry.installDeps(defaultBrowsersToInstall({}), !!options.dryRun);
249
- else
250
- await import_server.registry.installDeps(checkBrowsersToInstall(args, {}), !!options.dryRun);
206
+ await import_server.registry.installDeps(import_server.registry.resolveBrowsers(args, {}), !!options.dryRun);
251
207
  } catch (e) {
252
208
  console.log(`Failed to install browser dependencies
253
209
  ${e}`);
@@ -259,7 +215,7 @@ Examples:
259
215
  Install dependencies for default browsers.
260
216
 
261
217
  - $ install-deps chrome firefox
262
- Install dependencies for specific browsers, supports ${suggestedBrowsersToInstall()}.`);
218
+ Install dependencies for specific browsers, supports ${import_server.registry.suggestedBrowsersToInstall()}.`);
263
219
  const browsers = [
264
220
  { alias: "cr", name: "Chromium", type: "chromium" },
265
221
  { alias: "ff", name: "Firefox", type: "firefox" },