Skip to content

Navbar: fix New UI switch crash in Firefox/Safari#84

Merged
Panthevm merged 1 commit into
masterfrom
fix-new-ui-cookie-store-firefox
May 21, 2026
Merged

Navbar: fix New UI switch crash in Firefox/Safari#84
Panthevm merged 1 commit into
masterfrom
fix-new-ui-cookie-store-firefox

Conversation

@Panthevm
Copy link
Copy Markdown
Collaborator

Summary

  • cookieStore is a Chromium-only experimental API; toggling the "New UI" switch threw Uncaught ReferenceError: cookieStore is not defined in Firefox and Safari.
  • Add a setCookie helper in src/utils/cookie.ts that uses cookieStore when available and falls back to document.cookie everywhere else.
  • Use the helper in src/layout/navbar.tsx instead of calling cookieStore.set directly.

Test plan

  • Chrome/Edge: toggle "New UI" off → cookie aidbox-preferred-ui=old is set, page redirects to legacy UI.
  • Firefox: toggle "New UI" off → no ReferenceError in console, cookie is set, redirect happens.
  • Safari: same as Firefox.

cookieStore is a Chromium-only experimental API, so toggling the
"New UI" switch threw a ReferenceError in non-Chromium browsers.
Add a setCookie helper that uses cookieStore when available and
falls back to document.cookie everywhere else.
@Panthevm Panthevm merged commit 19d9a2d into master May 21, 2026
4 checks passed
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