webcompat / webcompat.com

Source code for webcompat.com
https://webcompat.com
353 stars 187 forks source link

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

Open sv-calin opened 1 year ago

sv-calin commented 1 year ago

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

karlcow commented 1 year ago

@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?

sv-calin commented 1 year ago

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

karlcow commented 1 year ago

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

miketaylr commented 1 year ago

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