Skip to content

Merge upstream puppeteer 22.15.0 - #174

Open
ruifigueira wants to merge 45 commits into
mainfrom
merge-22.15.0
Open

Merge upstream puppeteer 22.15.0#174
ruifigueira wants to merge 45 commits into
mainfrom
merge-22.15.0

Conversation

@ruifigueira

Copy link
Copy Markdown
Collaborator

What kind of change does this PR introduce?

Did you add tests for your changes?

If relevant, did you update the documentation?

Summary

Does this PR introduce a breaking change?

Other information

OrKoN and others added 30 commits July 17, 2024 12:52
Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
…er BiDi (#12771)

Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…799)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
dependabot Bot and others added 12 commits July 29, 2024 08:24
… (#12835)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ith 10 updates (#12841)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…e all group (#12837)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
}
spawnSync(
path.join(browserDir, 'setup.exe'),
[`--configure-browser-in-directory=` + browserDir],

Check warning

Code scanning / CodeQL

Unsafe shell command constructed from library input Medium

This shell argument which depends on
library input
is later used in a
shell command
.

Copilot Autofix

AI 7 months ago

In general, the fix is to avoid letting untrusted or library-controlled data be interpreted by a shell. For Node’s child_process, that means using spawn/spawnSync with shell: false (the default) and passing arguments as an array, or using execFile instead of exec. If you truly need shell features like pipes or redirection, input must be carefully quoted/escaped with something like shell-quote.

In this specific case, runSetup only needs to run setup.exe with a single argument --configure-browser-in-directory=<browserDir>. There is no need for shell features, so we can safely call spawnSync directly with shell: false. Since spawnSync is already called with the program path and an array of arguments, the minimal fix is:

  • Remove the { shell: true } option so the shell is not involved.
  • Optionally (but not strictly necessary for correctness), we can pass the argument as a full string as we already do: `--configure-browser-in-directory=` + browserDir. spawnSync will handle it as one argument.

This preserves existing functionality (invoking setup.exe with the same argument) while preventing any shell interpretation of browserDir. No additional imports, methods, or dependencies are required. All changes occur in packages/browsers/src/install.ts within the runSetup function.

Suggested changeset 1
packages/browsers/src/install.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/browsers/src/install.ts b/packages/browsers/src/install.ts
--- a/packages/browsers/src/install.ts
+++ b/packages/browsers/src/install.ts
@@ -288,13 +288,9 @@
       if (!existsSync(setupExePath)) {
         return;
       }
-      spawnSync(
-        path.join(browserDir, 'setup.exe'),
-        [`--configure-browser-in-directory=` + browserDir],
-        {
-          shell: true,
-        }
-      );
+      spawnSync(path.join(browserDir, 'setup.exe'), [
+        `--configure-browser-in-directory=` + browserDir,
+      ]);
       // TODO: Handle error here. Currently the setup.exe sometimes
       // errors although it sets the permissions correctly.
     } finally {
EOF
@@ -288,13 +288,9 @@
if (!existsSync(setupExePath)) {
return;
}
spawnSync(
path.join(browserDir, 'setup.exe'),
[`--configure-browser-in-directory=` + browserDir],
{
shell: true,
}
);
spawnSync(path.join(browserDir, 'setup.exe'), [
`--configure-browser-in-directory=` + browserDir,
]);
// TODO: Handle error here. Currently the setup.exe sometimes
// errors although it sets the permissions correctly.
} finally {
Copilot is powered by AI and may make mistakes. Always verify output.
@ruifigueira
ruifigueira force-pushed the merge-22.15.0 branch 2 times, most recently from 80d9375 to 57c562e Compare February 23, 2026 19:09
- Merge 42 commits from upstream puppeteer-core v22.15.0
- Resolves conflicts keeping Cloudflare Workers compatibility
- Removes BiDi files (not supported in Workers fork)
- Updates dependencies:
  - @puppeteer/browsers: 2.2.4 -> 2.3.0
  - devtools-protocol: 0.0.1299070 -> 0.0.1312386
  - debug: ^4.3.5 -> ^4.3.6
- Bumps @cloudflare/puppeteer version to 1.0.7
- Updates README to reflect upstream version 22.15.0

Key upstream changes included:
- feat: support AbortSignal in waitForNavigation
- fix: roll to Chrome 127.0.6533.88
- refactor: remove EventSubscription
- Various bug fixes and improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants