Bug 216593 - [macOS] Limit reported macOS release to 10.15 series
Summary: [macOS] Limit reported macOS release to 10.15 series
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-15 18:14 PDT by Brent Fulgham
Modified: 2021-07-31 13:28 PDT (History)
12 users (show)

See Also:


Attachments
Patch (1.65 KB, patch)
2020-09-15 18:18 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2020-09-15 18:14:20 PDT
The world apparently isn't ready for macOS 11.0 in User Agents. Because of the depressing UA sniffing code on the web, let's just report our current shipping release until things settle down.
Comment 1 Brent Fulgham 2020-09-15 18:14:36 PDT
<rdar://68937905>
Comment 2 Brent Fulgham 2020-09-15 18:18:50 PDT
Created attachment 408883 [details]
Patch
Comment 3 Maciej Stachowiak 2020-09-15 21:13:03 PDT
Comment on attachment 408883 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408883&action=review

> Source/WebCore/platform/mac/UserAgentMac.mm:39
> +        osVersion = "10_15_6"_s;

Why do it this roundabout way instead of hardcoding this to "10_15_6"_s always? Under what circumstances would osVersion not start with 10? And if we fully hardcoded it, maybe we could encode it directly in the template string, same as the AppleWebKit/ version number.
Comment 4 Maciej Stachowiak 2020-09-15 21:14:12 PDT
Comment on attachment 408883 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408883&action=review

r=me

>> Source/WebCore/platform/mac/UserAgentMac.mm:39
>> +        osVersion = "10_15_6"_s;
> 
> Why do it this roundabout way instead of hardcoding this to "10_15_6"_s always? Under what circumstances would osVersion not start with 10? And if we fully hardcoded it, maybe we could encode it directly in the template string, same as the AppleWebKit/ version number.

Oh, I understand now. This is to preserve original OS version on older macOS.
Comment 5 Brent Fulgham 2020-09-16 09:18:56 PDT
(In reply to Maciej Stachowiak from comment #4)
> Comment on attachment 408883 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=408883&action=review
> 
> r=me
> 
> >> Source/WebCore/platform/mac/UserAgentMac.mm:39
> >> +        osVersion = "10_15_6"_s;
> > 
> > Why do it this roundabout way instead of hardcoding this to "10_15_6"_s always? Under what circumstances would osVersion not start with 10? And if we fully hardcoded it, maybe we could encode it directly in the template string, same as the AppleWebKit/ version number.
> 
> Oh, I understand now. This is to preserve original OS version on older macOS.

Yes, exactly. That was Charles's request.
Comment 6 EWS 2020-09-16 09:34:36 PDT
Committed r267148: <https://trac.webkit.org/changeset/267148>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 408883 [details].
Comment 7 akielbas 2021-02-03 11:54:41 PST
Out of curiosity, when will this be changed again?

Would a better option perhaps have been to change it to 10.16 instead (which is what older Xcode versions did)? So that Big Sur can still be detected?
Comment 8 Ryosuke Niwa 2021-02-03 22:14:25 PST
(In reply to akielbas from comment #7)
> Out of curiosity, when will this be changed again?
> 
> Would a better option perhaps have been to change it to 10.16 instead (which
> is what older Xcode versions did)? So that Big Sur can still be detected?

The long term goal is to limit the disclosure of the underlying macOS via user agent string and other means since it can be used for finger printing purposes.
Comment 9 Eric Portis 2021-02-10 15:34:22 PST
Cloudinary is struggling to implement a workaround for https://bugs.webkit.org/show_bug.cgi?id=219977 / rdar://problem/72485913, which affects MacOS ≥ 11.1. Is there any reliable way to detect platform version, currently?
Comment 10 karl 2021-02-14 22:30:53 PST
Brent, Maciej,

> The world apparently isn't ready for macOS 11.0 in User Agents. Because of the depressing UA sniffing code on the web, let's just report our current shipping release until things settle down.

Do you have examples of sites which were breaking because of the OS information in the UA string?

I'm trying to retrace the origin of it. 
https://www.otsukare.info/2021/02/15/capping-macos-user-agent

We (Mozilla) are likely to try to work together with Google Chrome team on understanding the webcompat space as we are in the process of making similar changes.
Comment 11 Aodhan Cullen 2021-07-14 03:12:25 PDT
(In reply to Ryosuke Niwa from comment #8)
> (In reply to akielbas from comment #7)
> > Out of curiosity, when will this be changed again?
> > 
> > Would a better option perhaps have been to change it to 10.16 instead (which
> > is what older Xcode versions did)? So that Big Sur can still be detected?
> 
> The long term goal is to limit the disclosure of the underlying macOS via
> user agent string and other means since it can be used for finger printing
> purposes.

That doesn't really make sense, as you were happy to report is as macOS 11.0 - but only rolled it back when it broke some websites?

We can't report on Big Sur usage correctly for the world any more at

https://gs.statcounter.com/macos-version-market-share/desktop/worldwide

Could you reconsider changing it to 10.16?
Comment 12 Jonathan Watt 2021-07-31 13:28:31 PDT
FWIW Mozilla made the same change in Firefox 87 to report 10.15 forever to reduce fingerprint surface[1] (backported to Firefox ESR 78). That was after initially adding various special cases to report 10.16 for specific sites for web compat[2].

1. https://bugzilla.mozilla.org/show_bug.cgi?id=1679929
2. e.g. https://github.com/mozilla-extensions/webcompat-addon/pull/200