Closed Bug 1716785 Opened 4 years ago Closed 4 years ago

We always report MacOS 10.15 in the profile meta information

Categories

(Core :: Gecko Profiler, defect, P3)

Unspecified
macOS
defect

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: julienw, Assigned: mozbugz)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Profile.meta.oscpu seems to take its value from the same data as navigator.oscpu, which has been frozen to avoid fingerprinting.

We should change this to report the right value.

Note that in the profiler frontend we're parsing this value in an adhoc way (see [1]), but the logic can also be modified if necessary.

[1] https://github.com/firefox-devtools/profiler/blob/78c4dd7bde137e342289240f436938a642422470/src/profile-logic/profile-metainfo.js#L66-L72

The profiler retrieves the information for profile.meta.oscpu from nsHttpHandler::GetOscpu(), which on macOS, is hard-coded to a maximum of "10.15"!

A comment above that explains:

Cap the reported macOS version at 10.15 (like Safari) to avoid breaking sites that assume the UA's macOS version always begins with "10.".

Chris, you wrote that comment. will it be true forever?

(If yes, I guess we could copy that code to the Profiler, and update it to show the real macOS version in the Profiler meta info.)

Severity: -- → S3
Flags: needinfo?(cpeterson)
Priority: -- → P3

(In reply to Gerald Squelart [:gerald] (he/him) from comment #1)

A comment above that explains:

Cap the reported macOS version at 10.15 (like Safari) to avoid breaking sites that assume the UA's macOS version always begins with "10.".

Chris, you wrote that comment. will it be true forever?

Yes. Like Safari and Chrome, Firefox's navigator.userAgent and navigator.oscpu APIs are capped at "Mac OS X 10.15" for macOS versions >= 11.0. Firefox on macOS versions <= 10.15, the navigator APIs will still report the real macOS version.

(If yes, I guess we could copy that code to the Profiler, and update it to show the real macOS version in the Profiler meta info.)

I don't know of any method for unprivileged JavaScript content to learn the real macOS version >= 11.0. From C++, you can nsCocoaFeatures::macOSVersionMajor() and macOSVersionMinor() to get the real macOS versions like:

https://searchfox.org/mozilla-central/rev/f351e19360729b351bfc7c1386d6e4ca4ea676e2/netwerk/protocol/http/nsHttpHandler.cpp#890-891

Flags: needinfo?(cpeterson) → needinfo?(gsquelart)

Thank you Chris for the info.
I'll be working in the Gecko Profiler native code, so that should (hopefully) work for me.

Assignee: nobody → gsquelart
Flags: needinfo?(gsquelart)

We are using the OS version as reported in the user agent string, but on macOS the version is capped at 10.15. This patch now reports the real and full OS version.

Attachment #9235321 - Attachment description: Bug 1716785 - Report the uncapped macOS version in profile.meta.oscpu - r?florian → Bug 1716785 - Report the uncapped macOS version in profile.meta.oscpu - r?canaltinova
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bc276ddc4e63 Report the uncapped macOS version in profile.meta.oscpu - r=canaltinova

FYI, the Windows version in oscpu is similarly capped here:

https://searchfox.org/mozilla-central/rev/bb5549df90f9b0f5b453f9d8e872a94e503c64a6/netwerk/protocol/http/nsHttpHandler.cpp#913-923

Whether we will raise oscpu's cap from Windows 10.0 to 11.0 is TBD. (I see that Chrome's and Edge's UA strings still report "Windows NT 10.0" on Windows 11 Beta.)

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch

(In reply to Chris Peterson [:cpeterson] from comment #6)

FYI, the Windows version in oscpu is similarly capped

Thank you Chris. I've just filed bug 1725076 to look into it.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: