Skip to content

[pull] master from apify:master#245

Merged
pull[bot] merged 1 commit into
threatcode:masterfrom
apify:master
Jul 17, 2026
Merged

[pull] master from apify:master#245
pull[bot] merged 1 commit into
threatcode:masterfrom
apify:master

Conversation

@pull

@pull pull Bot commented Jul 17, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Puppeteer 25 is ESM-only, requires Node 22.12+, and its bundled Chrome
changes a few behaviors. This adds support for it while keeping
compatibility with older versions:

- suppress the type-only ESM import errors with inert `@ts-ignore`
comments (same approach as for got-scraping), so the code compiles
against both puppeteer 24 (CJS) and 25+ (ESM-only) — the published
`.d.ts` shape is unchanged
- map the removed `clickCount` click option to its `count` replacement
in `clickElements()`, passing both through so older versions keep
working
- set a `User-Agent` header from `gotoExtended()` via
`page.setUserAgent()`, since newer Chrome ignores it in
`setExtraHTTPHeaders()`
- normalize the new `sameSite: 'Default'` cookie value to `undefined` in
session cookies
- bound the `page.close()` call in request cleanup with a 5s timeout —
puppeteer 25 can hang it indefinitely when the page's navigation was
aborted (e.g. on a navigation timeout), which blocked the crawler
forever

No new runtime version detection was needed — the existing
`CdpBrowser`/`package.json` checks still work with v25, and
`require('puppeteer')` works there because v25's minimum Node has
`require(esm)`.

Everything is verified locally against both puppeteer 24.36.1 and 25.3.0
(build, type checks, and the full puppeteer test suites, including under
CPU load for the timeout tests).

Supersedes #3772.
@pull pull Bot locked and limited conversation to collaborators Jul 17, 2026
@pull pull Bot added the ⤵️ pull label Jul 17, 2026
@pull
pull Bot merged commit 1430062 into threatcode:master Jul 17, 2026
@pull
pull Bot had a problem deploying to github-pages July 17, 2026 10:19 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant