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

Avoid suggesting the empty string for navigator.platform #7762

Merged
merged 2 commits into from
Mar 30, 2022

Conversation

hsivonen
Copy link
Member

@hsivonen hsivonen commented Mar 30, 2022

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 believe this change counts as editorial for Work Mode purposes even though it is suggestive of slightly more substantive direction.


/system-state.html ( diff )

`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.
@hsivonen
Copy link
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.

source Outdated Show resolved Hide resolved
Copy link
Member

@domenic domenic left a 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.

@domenic domenic merged commit cac6b41 into whatwg:main Mar 30, 2022
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants