Include partitioned cookies in export
Firefox 141 added support for partitioned cookies^1. In order for extensions to retrieve these cookies, they need to pass a new partitionKey object^2.
While we could consider adding options to filter which cookies are exported, for now the easy win is to select all partitions, so this commit just passes an empty object to select them all.
There's no support for partitions in the cookies.txt format or in any of the tools that consume it, but it can be useful to see the partition for debugging, so this commit includes it in a comment.
Would it be possible to make this behaviour conditional on the browser actually supporting it? There are some non-Firefox code paths (I don't test with chromium though) and your change breaks cookie export on the ESR, which is based on Firefox 140.
Would it be possible to make this behaviour conditional on the browser actually supporting it? There are some non-Firefox code paths (I don't test with chromium though) and your change breaks cookie export on the ESR, which is based on Firefox 140.
I don't know of a way to directly query for support, but we could probably condition on browser version. But apparently I was mistaken about the support matrix - partitionKey itself was added all the way back in Firefox 94, it's just not used to segment cookies by default until 141.
My (brief) testing on the ESR seems to work, including partition comments - do you have a specific case I can test that wasn't working for you?