I am running macOS Monterey (12.2) with Safari 15.3. I am trying to use JavaScript in Safari (or Chrome) to programmatically determine the version of macOS installed.
When I run the following command:
var nAgt = navigator.userAgent;
I get the following results:
Safari
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15
Google Chrome
Mozilla/5.0 (Macintosh; Intel Mac OS X10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36