Comments (10)
@nicjansma initially client hints only persist on browsing session level, however, starting from M103, we made the client hints persisted even browser restarts. we probably need to clean up some documents to avoid the confusion.
context: https://bugs.chromium.org/p/chromium/issues/detail?id=1296339
I tested the latest chrome canary on Android and mac os:
- 112.0.5579.0 on mac os. has no issue when restart.
- 112.0.5579.0 on Android (pixel 5) has no issue when restart.
I will try to verify any issues in Windows 11 as well.
from client-hints-infrastructure.
I'm also not seeing any unexpected behavior in the above scenarios, another note is that you won't see client hints change in the first request header after you change the accept_ch list in the response header because client is unaware of the server’s most recent preferences. All sub-requests will notice the accept_ch header changes.
You can use critical_ch
, If corresponding client hints headers didn't send in the original request, the user agent will retry the request along with the client hints headers rather than render the page.
from client-hints-infrastructure.
It looks like the client hints cache should persist between browser sessions: https://source.chromium.org/chromium/chromium/src/+/main:components/content_settings/core/browser/website_settings_registry.cc;l=179;drc=f775d850d7f5beebd9308f5d02111d6069083b28;bpv=0;bpt=1
However the persistence of the cache is marked as lossy so there may be some chance it's not being written? Although I would assume all lossy caches are at least written on normal browser close.
It seems like that comment that "cache is cleared when session cookies are cleared" is false, as it should persist unless all cookies are cleared manually.
Can you detail how you tested the persistence?
@yoavweiss if I'm missing something
from client-hints-infrastructure.
It seems like that comment that "cache is cleared when session cookies are cleared" is false, as it should persist unless all cookies are cleared manually.
Yeah, that should just say "cookies and other site data", right?
from client-hints-infrastructure.
I was just using user-agent-client-hints.glitch.me for testing, i.e. asking for Sec-CH-UA-Platform-Version
Browser Restart Scenario:
- Nav to https://user-agent-client-hints.glitch.me/headers?uach=Sec-CH-UA-Platform-Version
- Client requests with default hints, i.e. w/out
Sec-CH-UA-Platform-Version
- Server sends
Accept-CH: Sec-CH-UA-Platform-Version
- Client requests with default hints, i.e. w/out
- Reload of the same page
- Client requests with
Sec-CH-UA-Platform-Version
- Server sends
Accept-CH: Sec-CH-UA-Platform-Version
- Client requests with
- Close browser
- Open Browser
- Nav to https://user-agent-client-hints.glitch.me/headers?uach=Sec-CH-UA-Platform-Version
- Client requests with default hints, i.e. w/out
Sec-CH-UA-Platform-Version
<-- this shows browse restarts don't persistAccept-CH
- Server sends
Accept-CH: Sec-CH-UA-Platform-Version
- Client requests with default hints, i.e. w/out
- Reload of the same page
- Client requests with
Sec-CH-UA-Platform-Version
- Server sends
Accept-CH: Sec-CH-UA-Platform-Version
- Client requests with
from client-hints-infrastructure.
Thanks @nicjansma - I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1413216 to investigate.
from client-hints-infrastructure.
I'm not seeing this reproduce locally. If I load and refresh https://user-agent-client-hints.glitch.me/headers?uach=Sec-CH-UA-Platform-Version so that the hint is included it works. If I open a new window or tab and load the page the hint appears without needing a reload. If I close all tabs and windows and re-open the browser and load https://user-agent-client-hints.glitch.me/headers?uach=Sec-CH-UA-Platform-Version it's still there without a refresh.
from client-hints-infrastructure.
Ok, I've done some additional testing:
- On macOS Monterey / 111.0.5554.0,
Accept-CH
hints are persisted between restarting Chrome Canary - On Windows 11 / 112.0.5576.0,
Accept-CH
hints are not persisted between restarting Chrome Canary
So maybe this is just a Windows bug? I haven't tested Android yet either.
(I'm not using an In Private session or anything to test, just closing and re-opening a vanilla Canary browser).
Back to my main question though: If I'm understanding the comments above correctly, the intent is for Accept-CH
hints to persist not only through the browsing session (which I think people generally understand to be until the browser closes), but across browser restarts as well, correct?
If so, when I'm reading documentation explaining hints ([1] [2]) etc, that talk about hint lifetimes persisting "for the browsing session" are accurate, but not complete, and could improve clarity by saying something like "for the browsing session and persisted (through browser restarts) until the site's data is cleared", or something.
i.e. MDN even says:
In other words, the request for a specific set of hints does not expire until the browser is shut down
Happy to file tickets or make these changes for those docsets to clarify, just making sure I understand the intent :)
from client-hints-infrastructure.
The latest canary should fix the persisted client hints issue on Windows.
from client-hints-infrastructure.
@Tanych that's great! I'll followup with trying to get those other docsets updated. I'll probably open a PR for this repo too to add that clarification in the explainer, if that's OK.
from client-hints-infrastructure.
Related Issues (20)
- Make it clear that UAs are not required to support every client hint ever HOT 5
- iFrame cross domain support HOT 3
- browser retries from the beginning of the multiple redirection with critical-ch HOT 4
- Define "brand" and "full version" for CH-UA HOT 3
- Usability of ACCEPT_CH frame HOT 1
- Define "high entropy" hint
- Integrate at the correct point in Fetch
- Access Client Hints can't be delegated to the document opting-in using `<meta>` tags HOT 10
- Are there any example to apply ACCEPT_CH frame on loadbalancer?
- Consider a new class of low-entropy CHs that a subresource can request HOT 1
- RFC 8942 does not define Critical-CH
- Clarification on multiple Accept-CH headers, ACCEPT_CH and/or <meta http-equiv> tags HOT 7
- CORS preflight requests and UA-CH HOT 8
- Google Ads does not respect Critical-CH restart HOT 7
- Bug in spec, subresources don't get client hints as a result HOT 1
- Define Critical-CH Restart logic more rigorously. HOT 4
- Empty Accept-CH being used to clear Client Hint requests HOT 12
- Primary brand name for Sec-CH-UA and Sec-CH-UA-Full-Version-List HOT 6
- Is Delegate-CH a pragma or not? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client-hints-infrastructure.