How to detect Big Sur from Javascript

Hey guys,

I have to show a very specific error message to the Big Sur users. I see the discrimination on the OS version.

#1. From the browser, inspect element from the developer tools > console tab> window.navigator

appVersion: "5.0 (Macintosh; Intel Mac OS X 10156) AppleWebKit/537.36 (KHTML, like Gecko)"


#2. Click on the About this mac (top left corner) it shows the version as 11.0.1

I just wanted to know how to detect Big Sur from Javascript.


Screenshot attached (remove the space from the below link)
https: //ibb.co/tD8YcvK


How to detect Big Sur from Javascript
 
 
Q