Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UAs SHOULD have more than a single brand value (Was: Stronger encouragement on set of UA strings) #22

Closed
domenic opened this issue Jan 14, 2020 · 1 comment · Fixed by #81

Comments

@domenic
Copy link
Collaborator

domenic commented Jan 14, 2020

https://github.com/WICG/ua-client-hints#should-the-ua-string-be-a-set indicates an idea of there being a set of user agents.

Although it is unclear why this would be a good idea (#21), if we assume it's desirable, I worry that the current design does not do enough to encourage web developers to treat the UA list as a set. Unless early browser implementations follow this optional part of the spec, I imagine we'll see a lot of parsing code for Sec-CH-UA which assumes there's only a single value. (See also #7 (comment).) This will effectively prevent any later browser from ever implementing the optional steps in the spec, because doing so would break server assumptions.

Additionally, the JS API always returns a single string, not a set.

If the intention is to encourage treating the UA as a set of possible UAs, then I think you need to make changes such as:

  • Changing Sec-CH-UA to a structured header list of strings, instead of a structured header string.
  • Potentially mandating, or at least strongly suggesting, that browsers always include >= 2 items in the list. (Especially early implementations.)
  • Change the JS API so that getUserAgent() returns a promise for an array of NavigatorUADatas, or possibly change NavigatorUAData's platform and version members to be arrays instead.
@yoavweiss
Copy link
Collaborator

yoavweiss commented Jan 27, 2020

I believe this is (almost) closed by #46. #49 adds various explanations that are also related.

The only thing missing is a SHOULD for including more than a single item.

@yoavweiss yoavweiss changed the title Stronger encouragement on set of UA strings UAs SHOULD have more than a single brand value (Was: Stronger encouragement on set of UA strings) Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants