Include partitioned cookies in export - #32
Conversation
|
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 - 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? |
|
I can't reproduce the issue I was experiencing when testing with Firefox 140.7.0. I'll merge your changes if you rebase them onto |
Firefox 141 added support for partitioned cookies[^1] by default. In order for extensions to retrieve these cookies, they need to pass a `partitionKey` object, which has been supported since Firefox 94[^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. [^1]: https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies [^2]: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/getAll#browser_compatibility
90a8624 to
7f66b8c
Compare
|
Rebased, and tested working on both ESR and 147. |
|
Tested this in Firefox 150, it works and solves the issue for me |
Firefox 141 added support for partitioned cookies1. In order for extensions to retrieve these cookies, they need to pass a new
partitionKeyobject2.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.
Footnotes
https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies ↩
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/getAll#partitionkey ↩