Skip to content

fix: support modern Chromium cookie restore - #129

Draft
chenggaofeng wants to merge 1 commit into
easychen:mainfrom
chenggaofeng:agent/modern-chromium-cookie-restore
Draft

fix: support modern Chromium cookie restore#129
chenggaofeng wants to merge 1 commit into
easychen:mainfrom
chenggaofeng:agent/modern-chromium-cookie-restore

Conversation

@chenggaofeng

@chenggaofeng chenggaofeng commented Jul 12, 2026

Copy link
Copy Markdown

What changed

  • preserve Chromium partitioned-cookie metadata when restoring cookies
  • keep host-only cookies host-only instead of converting them to domain cookies
  • enforce __Host- and __Secure- prefix requirements
  • omit unsupported SameSite=unspecified values
  • add progressive compatibility fallbacks for modern Chrome and Edge
  • report accurate success, partial-success, and failure counts
  • add focused normalization and fallback tests

Why

The current restore path converts every cookie into a domain cookie and drops modern Chromium fields such as partitionKey. Modern Chrome and Edge can reject those writes, especially for host-only cookies, partitioned cookies, cookie prefixes, or insecure URL/scheme combinations. The popup may report that synchronization completed even when part of the restore failed.

This change normalizes the cookie payload before calling cookies.set() and retries only with progressively safer representations when Chromium rejects the first form.

User impact

Cookie restore works on current Chromium-based browsers without silently dropping modern cookie types. The extension badge now distinguishes complete success, partial success, and total failure.

Validation

  • node --test utils/cookie-normalization.test.ts — 6 tests passed
  • pnpm compile — passed
  • pnpm build:chrome — passed
  • validated against Microsoft Edge 150 with a large real-world encrypted CookieCloud dataset; all 980 cookies restored successfully

No server API or encrypted data format changes are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant