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

Inconsistent standard status and deprecation of NavigatorID properties and methods #6567

Closed
alattalatta opened this issue Aug 26, 2020 · 1 comment · Fixed by #6612
Closed
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API

Comments

@alattalatta
Copy link
Member

alattalatta commented Aug 26, 2020

There are some inconsistencies within NavigatorID. Note that all of the following items are defined within the spec, even for those marked as non-standard.

Marked as standard, non-deprecated

  • appCodeName
  • appName
  • appVersion
  • platform
  • product
  • userAgent
  • vendor (Note: Defined in Navigator.json)

Marked as standard, deprecated

  • taintEnabled()

Marked as non-standard, non-deprecated

  • vendorSub (Note: Defined in Navigator.json)

Marked as non-standard, deprecated

  • oscpu (Note: Defined in Navigator.json)
  • productSub (Note: Defined in Navigator.json)

Considering that they are defined in the spec, shouldn't they all be marked as standard? Also, since most of these (except platform and userAgent) returns a constant or some historic value, IMO they should be deprecated, but I don't know about BCD's policy around deprecation.

@alattalatta alattalatta changed the title Inconsistency of NavigatorID properties and methods Inconsistent standard status and deprecation of NavigatorID properties and methods Aug 26, 2020
@queengooborg queengooborg added the data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Aug 26, 2020
sideshowbarker added a commit that referenced this issue Aug 31, 2020
This change consistently marks all members of NavigatorID as standard —
because they are all in fact defined in the HTML spec. And it marks
almost all as deprecated — because almost all of them are required to
return either a constant (and so, useless) value, or else are defined to
*optionally* return a constant value, but are strongly encouraged by the
spec to do return a constant value.

The only exceptions are:

* navigator.userAgent, defined to return a non-constant value

* navigator.vendor, defined to return a value depending on which engine
  the browser is running; either "Google Inc.", "Apple Computer, Inc.",
  or the empty string (for Gecko)
  https://html.spec.whatwg.org/multipage/#dom-navigator-useragent

Fixes #6567
@sideshowbarker
Copy link
Collaborator

Considering that they are defined in the spec, shouldn't they all be marked as standard?

Yes, for sure

Also, since most of these (except platform and userAgent) returns a constant or some historic value, IMO they should be deprecated,

Yes. But I think platform should also be deprecated – because, while UAs are optionally allowed to return a non-constant value for it, UAs are also allowed to just return the empty string for it. In fact, UAs are encouraged to return the empty string for it (and for all other NavigatorID members that only optionally have non-constant values); see the “user agent implementers are strongly urged to include as little information in this API as possible”.

So I think it is in fact the spec intent that platform should not be used or relied on — which effectively means deprecated.

And so, along with userAgent, the only other member that should not be marked as deprecated is vendor — because the spec does actually require UAs to return a non-constant value for that.

See #6612 for a patch the makes the changes as summarized above.

foolip pushed a commit that referenced this issue Aug 31, 2020
This change consistently marks all members of NavigatorID as standard —
because they are all in fact defined in the HTML spec. And it marks
almost all as deprecated — because almost all of them are required to
return either a constant (and so, useless) value, or else are defined to
*optionally* return a constant value, but are strongly encouraged by the
spec to do return a constant value.

The only exceptions are:

* navigator.userAgent, defined to return a non-constant value

* navigator.vendor, defined to return a value depending on which engine
  the browser is running; either "Google Inc.", "Apple Computer, Inc.",
  or the empty string (for Gecko)
  https://html.spec.whatwg.org/multipage/#dom-navigator-useragent

Fixes #6567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants