WICG / ua-client-hints

Wouldn't it be nice if `User-Agent` was a (set of) client hints?
https://wicg.github.io/ua-client-hints/
Other
590 stars 77 forks source link

CORs Requests #279

Open dgstpierre opened 2 years ago

dgstpierre commented 2 years ago

When using XMLHttpRequest I don't need to worry about setting any accept-ch headers. I also avoid the costly overhead of a preflight call by limiting the headers sent. How will we be able to make third party API calls ensuring that the detailed ua client hints are sent and not introducing a preflight?

Sora2455 commented 2 years ago

By adding the results of the UA JA API as part of the JSON body?

dgstpierre commented 2 years ago

We can do this as with any data. Just seems that we are adding lots of overhead for something that was seamless before.

nicjansma commented 2 years ago

Accept-CH can only be applied to the base page's HTTP response -- setting it on outgoing Fetch/XHRs will have no effect.

(then you would add a Permissions-Policy on the same base page HTTP response to delegate the required hints to the XHR domain)

frankykubo commented 1 year ago

Hello,

so if I understand this right @nicjansma , there is and probably will not be an approach to include high-entropy UA client hints like Arch without manually appending them to XHR's via JS Client hints API?

Thank you