Avoid suggesting the empty string for navigator.platform#7762
Merged
domenic merged 2 commits intowhatwg:mainfrom Mar 30, 2022
Merged
Avoid suggesting the empty string for navigator.platform#7762domenic merged 2 commits intowhatwg:mainfrom
navigator.platform#7762domenic merged 2 commits intowhatwg:mainfrom
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.
Member
Author
|
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. |
domenic
approved these changes
Mar 30, 2022
Member
domenic
left a comment
There was a problem hiding this comment.
Nice change, thank you. I think the most relevant issue to the eventual narrowing is whatwg/compat#174.
sideshowbarker
added a commit
to sideshowbarker/browser-compat-data
that referenced
this pull request
Mar 31, 2022
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
sideshowbarker
added a commit
to mdn/content
that referenced
this pull request
Mar 31, 2022
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
sideshowbarker
added a commit
to mdn/content
that referenced
this pull request
Mar 31, 2022
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
teoli2003
added a commit
to mdn/content
that referenced
this pull request
Mar 31, 2022
…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]>
This was referenced Oct 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
navigator.platformwas 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 )