Skip to content

Commit

Permalink
Avoid suggesting the empty string for navigator.platform
Browse files Browse the repository at this point in the history
navigator.platform was permitted to return the empty string due to a privacy-motivated spec change in ecefa6e.

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.

Further work on constraining these values is tracked mostly in https://github.com/whatwg/compat; see especially whatwg/compat#174.
  • Loading branch information
hsivonen authored and Mason Freed committed Jun 3, 2022
1 parent 80f4980 commit 7b65aca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -98597,9 +98597,10 @@ interface <dfn interface>Navigator</dfn> {
<!-- oscpu: Mozilla only -->

<dt><dfn attribute for="NavigatorID"><code data-x="dom-navigator-platform">platform</code></dfn></dt>
<dd><p>Must return either the empty string or a string representing the platform on which the
browser is executing, e.g. "<code data-x="">MacIntel</code>", "<code data-x="">Win32</code>",
"<code data-x="">FreeBSD i386</code>", "<code data-x="">WebTV OS</code>".</p></dd>
<dd><p>Must return a string representing the platform on which the
browser is executing (e.g. "<code data-x="">MacIntel</code>", "<code data-x="">Win32</code>",
"<code data-x="">Linux x86_64</code>", "<code data-x="">Linux armv81</code>") or, for privacy and
compatibility, a string that is commonly returned on another platform.</p></dd>

<dt><dfn attribute for="NavigatorID"><code data-x="dom-navigator-product">product</code></dfn></dt>
<dd><p>Must return the string "<code data-x="">Gecko</code>".</p></dd>
Expand Down

0 comments on commit 7b65aca

Please sign in to comment.