Repository navigation
fix(bidi): return domain cookies for the domain itself in page.cookies() - #15689
Merged
wolfib merged 1 commit intoOct 29, 2026
Merged
Conversation
A cookie whose domain has a leading dot (for example one set with
`Domain=example.com`) applies to `example.com` as well as its
subdomains (RFC 6265, section 5.1.3). The BiDi `page.cookies()` filter
only checked `hostname.endsWith('.example.com')`, so such cookies were
dropped for `https://example.com` while CDP returned them.
Merged
dadezzz
pushed a commit
to dadezzz/events-cash-register
that referenced
this pull request
Nov 14, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [puppeteer-core](https://github.com/puppeteer/puppeteer/tree/main#readme) ([source](https://github.com/puppeteer/puppeteer)) | [`25.16.0` → `25.17.0`](https://renovatebot.com/diffs/npm/puppeteer-core/25.16.0/25.17.0) |  |  | --- ### Release Notes <details> <summary>puppeteer/puppeteer (puppeteer-core)</summary> ### [`v25.17.0`](https://github.com/puppeteer/puppeteer/releases/tag/puppeteer-core-v25.17.0): puppeteer-core: v25.17.0 [Compare Source](puppeteer/puppeteer@puppeteer-core-v25.16.0...puppeteer-core-v25.17.0) ##### 🎉 Features - add console events to Browser and BrowserContext ([#​15710](puppeteer/puppeteer#15710)) ([e9894e3](puppeteer/puppeteer@e9894e3)) - add HTTPResponse.stream() ([#​15717](puppeteer/puppeteer#15717)) ([8fab4dc](puppeteer/puppeteer@8fab4dc)) - add page and worker methods on HTTPRequest ([#​15514](puppeteer/puppeteer#15514)) ([9b2fe5e](puppeteer/puppeteer@9b2fe5e)) - add request events to Browser and BrowserContext ([#​15539](puppeteer/puppeteer#15539)) ([b99132a](puppeteer/puppeteer@b99132a)) - add scriptId to ConsoleMessageLocation ([#​15537](puppeteer/puppeteer#15537)) ([f3511d8](puppeteer/puppeteer@f3511d8)) - **cdp:** expose DomContentLoaded and NavigationStart in page.metrics() ([#​15676](puppeteer/puppeteer#15676)) ([5862b81](puppeteer/puppeteer@5862b81)) - expose HTTPResponse.encodedDataLength() ([#​15678](puppeteer/puppeteer#15678)) ([9abca26](puppeteer/puppeteer@9abca26)) - introduce other network event on browser and browserContext ([#​15726](puppeteer/puppeteer#15726)) ([9319ada](puppeteer/puppeteer@9319ada)) - **locators:** support passing arguments to Locator.filter and Locator.map ([#​15684](puppeteer/puppeteer#15684)) ([a0b2b8d](puppeteer/puppeteer@a0b2b8d)) - report dedicated worker console messages on Browser and BrowserContext ([#​15711](puppeteer/puppeteer#15711)) ([092e6e6](puppeteer/puppeteer@092e6e6)) - roll to Chrome 157.0.8103.38 ([#​15716](puppeteer/puppeteer#15716)) ([591d736](puppeteer/puppeteer@591d736)) - roll to Firefox 159.0 ([#​15685](puppeteer/puppeteer#15685)) ([de2e9f9](puppeteer/puppeteer@de2e9f9)) ##### 🛠️ Fixes - **bidi:** apply downloadBehavior from launch and connect options ([#​15687](puppeteer/puppeteer#15687)) ([d8cc590](puppeteer/puppeteer@d8cc590)) - **bidi:** deliver console messages replayed while connecting ([#​15712](puppeteer/puppeteer#15712)) ([5115e5c](puppeteer/puppeteer@5115e5c)) - **bidi:** enforce exhaustive switch in getBidiKeyValue and support Abort/NumpadEnter ([#​15654](puppeteer/puppeteer#15654)) ([7cb1c0b](puppeteer/puppeteer@7cb1c0b)) - **bidi:** keep the plain GMT timezone ID in page.emulateTimezone() ([#​15728](puppeteer/puppeteer#15728)) ([026b426](puppeteer/puppeteer@026b426)) - **bidi:** let contentType replace a content-type header in respond() ([#​15653](puppeteer/puppeteer#15653)) ([7cb283c](puppeteer/puppeteer@7cb283c)) - **bidi:** make page.setCacheEnabled() enable the cache by default ([#​15698](puppeteer/puppeteer#15698)) ([4b211de](puppeteer/puppeteer@4b211de)) - **bidi:** respect waitForFonts in page.pdf() ([#​15714](puppeteer/puppeteer#15714)) ([0814ac1](puppeteer/puppeteer@0814ac1)) - **bidi:** return domain cookies for the domain itself in page.cookies() ([#​15689](puppeteer/puppeteer#15689)) ([884a8c3](puppeteer/puppeteer@884a8c3)) - **bidi:** send the default accuracy in page.setGeolocation() ([#​15704](puppeteer/puppeteer#15704)) ([8dfe2ff](puppeteer/puppeteer@8dfe2ff)) - **bidi:** send the Enter code for the Enter key ([#​15743](puppeteer/puppeteer#15743)) ([27e017c](puppeteer/puppeteer@27e017c)) - **bidi:** tolerate respond() and abort() failures for gone requests ([#​15697](puppeteer/puppeteer#15697)) ([1c4e4ad](puppeteer/puppeteer@1c4e4ad)) - **bidi:** update Request.isBlocked on network lifecycle events ([#​15677](puppeteer/puppeteer#15677)) ([a0d910a](puppeteer/puppeteer@a0d910a)) - **cdp:** allow calling exposed functions after deleting from globalThis ([#​15683](puppeteer/puppeteer#15683)) ([5c11065](puppeteer/puppeteer@5c11065)) - **cdp:** handle internal redirects not paused by Fetch.requestPaused ([#​15644](puppeteer/puppeteer#15644)) ([176afa2](puppeteer/puppeteer@176afa2)) - **cdp:** include null and undefined in ConsoleMessage.text() ([#​15693](puppeteer/puppeteer#15693)) ([e54f1db](puppeteer/puppeteer@e54f1db)) - deflake BiDi navigation and flaky tests from main CI ([#​15638](puppeteer/puppeteer#15638)) ([d8ef67a](puppeteer/puppeteer@d8ef67a)) - do not mutate options.args in defaultArgs ([#​15664](puppeteer/puppeteer#15664)) ([1581677](puppeteer/puppeteer@1581677)) - do not throw in evaluate when the caller stack frame is missing ([#​15666](puppeteer/puppeteer#15666)) ([28782a2](puppeteer/puppeteer@28782a2)) - **extensions:** support Target.attachToTarget in ExtensionTransport ([#​15647](puppeteer/puppeteer#15647)) ([c615311](puppeteer/puppeteer@c615311)) - fail pending worker requests on worker termination ([#​15538](puppeteer/puppeteer#15538)) ([7231774](puppeteer/puppeteer@7231774)) - **network:** emit requestfailed when loadingFailed precedes requestPaused ([#​15576](puppeteer/puppeteer#15576)) ([5b0c34a](puppeteer/puppeteer@5b0c34a)) - roll to Chrome 156.0.8078.73 ([#​15686](puppeteer/puppeteer#15686)) ([33f2ad6](puppeteer/puppeteer@33f2ad6)) - roll to Chrome 156.0.8078.80 ([#​15696](puppeteer/puppeteer#15696)) ([715534b](puppeteer/puppeteer@715534b)) - roll to Chrome 157.0.8103.50 ([#​15747](puppeteer/puppeteer#15747)) ([5a0d6de](puppeteer/puppeteer@5a0d6de)) - roll to Firefox 159.0.1 ([#​15715](puppeteer/puppeteer#15715)) ([62d357a](puppeteer/puppeteer@62d357a)) - type wildcard event emitter handlers correctly ([#​15643](puppeteer/puppeteer#15643)) ([08e7b1a](puppeteer/puppeteer@08e7b1a)) - validate CRLF in input HTTPRequest headers ([#​15601](puppeteer/puppeteer#15601)) ([d830850](puppeteer/puppeteer@d830850)) - **webdriver:** dispose requests that complete with a 3xx status but are not redirected ([#​15631](puppeteer/puppeteer#15631)) ([fac3a5b](puppeteer/puppeteer@fac3a5b)) - **webdriver:** support the Space key over WebDriver BiDi ([#​15650](puppeteer/puppeteer#15650)) ([346bace](puppeteer/puppeteer@346bace)) ##### 📄 Documentation - **pdf:** clarify emulateMediaType('screen') behavior with page.pdf() ([#​15636](puppeteer/puppeteer#15636)) ([a1149f3](puppeteer/puppeteer@a1149f3)) ##### ⚡ Performance - count in-flight requests in linear time ([#​15668](puppeteer/puppeteer#15668)) ([394e92d](puppeteer/puppeteer@394e92d)) ##### Dependencies - The following workspace dependencies were updated - dependencies - [@​puppeteer/browsers](https://github.com/puppeteer/browsers) bumped from 3.2.6 to 3.2.7 </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMzguMCIsInVwZGF0ZWRJblZlciI6IjQ0LjIzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix
Did you add tests for your changes?
Yes, a case in
test/src/cookies.test.ts.If relevant, did you update the documentation?
Not needed.
Summary
With WebDriver BiDi (Firefox, or Chrome with
protocol: 'webDriverBiDi'),page.cookies(url)drops domain cookies for the domain they belong to. A cookie set withDomain=example.comis reported as.example.com, and per RFC 6265 section 5.1.3 it applies toexample.comitself as well as its subdomains.testUrlMatchCookieHostnameonly checkedhostname.endsWith('.example.com'), sopage.cookies('https://example.com')returned nothing while CDP returned the cookie. The fix matches against.${hostname}instead.Does this PR introduce a breaking change?
No.
Other information
The new test fails on main with chrome-bidi and firefox-headless (expected length 1, received 0) and passes with the fix. It already passed on chrome-headless (CDP).
I used Claude Code to write this change.