webcompat.com icon indicating copy to clipboard operation
webcompat.com copied to clipboard

OS autodetect does not work correctly, Windows 11 detected as Windows 10

Open sv-calin opened this issue 2 years ago • 4 comments

Url: https://webcompat.com/issues/new

Environment: Operating system: Windows 11 Browser/Version: Firefox Release 114 / Chrome 114

Steps to reproduce:

  1. Go to https://webcompat.com/issues/new
  2. Complete the required steps for filing a bug report until you are asked where you've encountered this issue.
  3. Observe the detected Operating System.

Expected Behavior: The detected Operating System is Windows 11.

Actual Behavior: The detected Operating System is Windows 10.

image

Watchers: @softvision-raul-bucata @sv-calin

sv-calin avatar Jun 23 '23 10:06 sv-calin

@sv-calin when you expect it to be Windows 11. What is the user agent string of your browser? Both Chrome and Firefox have started to freeze parts of their user agent strings.

For example, if you go https://echo.opera.com with Windows 11, what is the UA string for Chrome and Firefox?

karlcow avatar Jun 23 '23 12:06 karlcow

from echo.opera.com

Firefox Nightly: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0 Chrome: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

from google.com

image image

Tested on: Windows 11

sv-calin avatar Jun 30 '23 11:06 sv-calin

So as you can see. This is normal. We can't fix this. :) It's on purpose. Browsers are starting to freeze the information in the UA string to avoid fingerprinting (and sniffing). :)

Some of these data maybe accessible through UA client hints but only in Chrome for now. @miketaylr might be able to confirm. I don't know if @ksy36 has enough time to parse Client Hints if the information is there

karlcow avatar Jun 30 '23 13:06 karlcow

Some of these data maybe accessible through UA client hints but only in Chrome for now.

Yeah, you can get the correct Windows version via UACH. See https://learn.microsoft.com/en-us/microsoft-edge/web-platform/how-to-detect-win11

miketaylr avatar Jun 30 '23 21:06 miketaylr