-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Avoid suggesting the empty string for navigator.platform
#7762
Conversation
`navigator.platform` was permitted to return the empty string due to a privacy-motivated spec change: https://searchfox.org/whatwg-html/diff/ecefa6e105592656bf592e0abcf0276dad971fbc/source#31141 Since 2008, the understanding of changing things like this for privacy has evolved from returning special privacy values to returning a value that is already commonly returned for non-privacy reasons. Therefore, change the spec not to say "the empty string" but to permit returning a string commonly returned on another platform. Additionally, change the examples to be from the set of values given at https://www.chromium.org/updates/ua-reduction/ to avoid suggesting more identifying and potentially less compatible values, but, for now, avoid actually constraining the permitted values to a reduced set.
I expect this API eventually to be specced to return one of 5 values, but I think it would be premature to spec this API that way before seeing experience from shipping a reduced set of possible values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change, thank you. I think the most relevant issue to the eventual narrowing is whatwg/compat#174.
Given the spec change at whatwg/html#7762 we no longer have justification for marking navigator.platform as deprecated. Related MDN change: mdn/content#14452
Fixes #14429. For the navigator.platform article, this change does the following: - Drop the Deprecated_Header macro. - Add admonishments that navigator.platform should be avoided in favor of feature detection. - Relegate mention of (equally-bad) navigator.userAgentData.platform to just being a "See also". - Add an example of the single known good case where using navigator.platform isn’t completely bad. Related BCD change: mdn/browser-compat-data#15599 Related spec change: whatwg/html#7762
Fixes #14429. For the navigator.platform article, this change does the following: - Drop the Deprecated_Header macro. - Add admonishments that navigator.platform should be avoided in favor of feature detection. - Relegate mention of (equally-bad) navigator.userAgentData.platform to just being a "See also". - Add an example of the single known good case where using navigator.platform isn’t completely bad. Related BCD change: mdn/browser-compat-data#15599 Related spec change: whatwg/html#7762
…vigator.platform doc and adjust navigator.userAgentData.platform note wording) (#14452) * Adjust wording of note about navigator.userAgentData.platform - Don’t say that navigator.userAgentData.platform is “recommended”; it’s sufficient to just point out that it exists as an alternative. - Since it’s so far only in Blink, say “not yet supported by **most** browsers” rather than “not yet supported by some major browsers. See #14429 * Replace Deprecated_Header in navigator.platform doc For the navigator.platform article, this change replaces the Deprecated_Header macro and its boilerplate text with some more-appropriate alternative pseudo-boilerplate text. See #14429 * Update files/en-us/web/api/navigator/platform/index.md Co-authored-by: wbamberg <[email protected]> * Drop “yet” in text about navigator.userAgentData.platform not being supported/adopted * Un-deprecate navigator.platform; improve advice and example Fixes #14429. For the navigator.platform article, this change does the following: - Drop the Deprecated_Header macro. - Add admonishments that navigator.platform should be avoided in favor of feature detection. - Relegate mention of (equally-bad) navigator.userAgentData.platform to just being a "See also". - Add an example of the single known good case where using navigator.platform isn’t completely bad. Related BCD change: mdn/browser-compat-data#15599 Related spec change: whatwg/html#7762 * Refine explanation of matching on navigator.platform value * Fix markdown formatting of example navigator.platform values * Grammar fix * Update files/en-us/web/api/navigator/platform/index.md Co-authored-by: Jean-Yves Perrier <[email protected]> Co-authored-by: wbamberg <[email protected]> Co-authored-by: Jean-Yves Perrier <[email protected]>
navigator.platform
was permitted to return the empty string due toa privacy-motivated spec change:
https://searchfox.org/whatwg-html/diff/ecefa6e105592656bf592e0abcf0276dad971fbc/source#31141
Since 2008, the understanding of changing things like this
for privacy has evolved from returning special privacy values
to returning a value that is already commonly returned for
non-privacy reasons. Therefore, change the spec not to say
"the empty string" but to permit returning a string commonly
returned on another platform.
Additionally, change the examples to be from the set of values
given at https://www.chromium.org/updates/ua-reduction/ to
avoid suggesting more identifying and potentially less
compatible values, but, for now, avoid actually constraining
the permitted values to a reduced set.
I believe this change counts as editorial for Work Mode purposes even though it is suggestive of slightly more substantive direction.
/system-state.html ( diff )