Warm tip: This article is reproduced from serverfault.com, please click

User agent string containing strange version number under macOS Big Sur

发布于 2020-11-20 11:59:50

I'm using macOS Big Sur 11.0.1.

I'm trying to get the OS version from the User Agent with this script:

$ua = $_SERVER['HTTP_USER_AGENT'];
echo "User Agent: $ua"; 

Output with Firefox (version 83.0):

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:82.0) Gecko/20100101 Firefox/82.0

Output with Safari (version 14.0.1):

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15

So:

  • Firefox reports Mac OS X 10.16
  • Safari reports Mac OS X 10.15.6

10.16 reported by Firefox is higher than the latest Catalina Version which is 10.15.7. As there is no Catalina 10.16 this can be used to detect "anything more recent than the newest Catalina".

But 10.15.6 reported by Safari is an actual version number of Catalina, so with Safari there is no way to detect Big Sur.

Does someone know what's going on here?

IMO both browsers should report 11.0.1.

Questioner
Jabberwocky
Viewed
0
halfday 2020-12-01 10:38:43

It's a temporary change.

"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."

https://bugs.webkit.org/show_bug.cgi?id=216593