This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27820 - Consider standardizing navigator.oscpu
Summary: Consider standardizing navigator.oscpu
Status: RESOLVED MOVED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://html.spec.whatwg.org/#the-nav...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-13 15:08 UTC by contributor
Modified: 2016-04-08 23:28 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2015-01-13 15:08:05 UTC
Specification: https://html.spec.whatwg.org/multipage/webappapis.html
Multipage: https://html.spec.whatwg.org/multipage/#the-navigator-object
Complete: https://html.spec.whatwg.org/#the-navigator-object
Referrer: https://html.spec.whatwg.org/multipage/

Comment:
Consider standardizing navigator.oscpu

Posted from: 98.110.194.132
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:37.0) Gecko/20100101 Firefox/37.0
Comment 1 Boris Zbarsky 2015-01-13 15:08:25 UTC
Note discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1120892
Comment 2 Philip Jägenstedt 2015-01-13 22:24:08 UTC
I did a fair bit of digging in the httparchive data, this was the worst thing I found, from http://www.littlealchemy.com/js/alchemy.js:

navigator.userAgent.toLowerCase().indexOf("firefox") > -1 && navigator.oscpu.toLowerCase().indexOf("windows nt 6.1") > -1 ...

That's the only really bad case I found, but there's bound to be more somewhere out there.

Any ideas about the compat constraints here, would the empty string or an alias of vendor.platform work?
Comment 3 Ian 'Hixie' Hickson 2015-01-13 23:20:54 UTC
How many browsers implement it?
Comment 4 Boris Zbarsky 2015-01-14 02:14:31 UTC
Just Firefox, but we can't drop it given site code of the sort in comment 2....

Empty string would make whatever sniffing is involved fail (not throw, which would be bad, just return false), but maybe that's OK.

Past that, I'm not sure what values this thing returns right now as compared to navigator.platform (I assume that's the one you meant?).  It might be possible to alias navigator.platform depending on what regexps people are matching against this string.
Comment 5 Philip Jägenstedt 2015-01-14 09:12:13 UTC
Right, I meant navigator.platform.

It would be nice to have a use counter-like number estimating the impact of removal for Firefox, but I realize that it's not really possible since you'd have to track how the string is used in the JS engine :/
Comment 6 Philip Jägenstedt 2015-01-14 13:31:41 UTC
navigator.cpuClass is similar, so I've asked the IE team to take a look:
https://connect.microsoft.com/IE/feedbackdetail/view/1087515/consider-removing-navigator-cpuclass
Comment 7 Ian 'Hixie' Hickson 2015-01-15 19:30:39 UTC
If only one browsers implements it, it seems like the shortest and safest path to interop here is for the other browsers to not do anything, and for that browser to spew console warnings, send advocacy e-mails warning of the impending doom of this feature,  and add a tracking counter to measure how use of this property drops over time, then finally remove it.
Comment 8 Boris Zbarsky 2015-01-15 19:45:09 UTC
Just to be clear, that's a path to interop that's measured in many years.  So if you're really aiming for "shortest", it's probably not it.  It's the least-effort one for non-Firefox browsers and spec authors, of course.
Comment 9 Domenic Denicola 2016-04-08 23:28:22 UTC
Now that we have "Gecko compatibility mode" for navigator, this seems worth fixing. https://github.com/whatwg/html/pull/1017