Is there methods to detect Windows-11 vs Windows-10 in Firefox browser?

Viewed 177

Currently,
    On Windows-11 devices I'm getting navigator.userAgent value as Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 Edg/103.0.1264.77 which is same as Windows-10.

To distinguish between Windows-10 vs Windows-11, I have used User-Agent Client Hints

navigator.userAgentData.getHighEntropyValues(['platformVersion']).then(function(uapv){
    console.log(uapv.platformVersion); 
    var winVer = Number(uapv.platformVersion.split('.')[0]);
    if(winVer>10){
        console.log("It's Win11")
    }else{
        console.log("It's Not Win11");
    }
});

But,
    User-Agent Client Hints are only supported in Chrome/Edge/Opera but not in Firefox.

So, is there a technique/library available to detect Windows-11 in Firefox ?

1 Answers
Related