Replies: 1 comment 3 replies
-
The way client hints like is that the browser will not send any until you first send an Accept-CH header asking for what client hints you want to use. This means the first time it will not send it, after that any request will go with the client hint header added, outside incognito you already accessed so your web already asked for the hint, in incognito this doesn’t happen so the browser don’t send it until the second request. Why do you want to use a client hint for this? The value of the client hint for dark mode would be the same you can detect with the color scheme media query, if your CSS use that it will detect light or dark mode automatically and you will not have a flash of incorrect color scheme. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have implemented a theme switcher for my site and initially I check the user's preferences to set the correct color scheme. In order to rea user's preference I set in
root.tsx
following header:It is perfectly working in Chrome (
Version 102.0.5005.115 (Official Build) (x86_64)
) but as soon as I switch to incognito mode the header won't be set on initial load. If then the page gets reloaded it will be set. I tried to move the logic toentry.server.tsx
but it didn't change that behavior.Is it normal that in incognito headers won't be set on initial load?
Beta Was this translation helpful? Give feedback.
All reactions