4 ms·
Very simple explanation: Microsoft is using a group of if/else if conditions, or some switch/select case structure, and it checks the user agent for every versi
by gbl08ma 13y ago
Very simple explanation: Microsoft is using a group of if/else if conditions, or some switch/select case structure, and it checks the user agent for every version of Windows except 8.1... 8.1 is the "default" (catch all) case, or the else in the end of the if structure. Basically who coded this page assumed (hopefully on accident) that the only OS in the world with Web browsing capabilities is Windows, and that if the version doesn't match any of the previous Windows versions, then it must be Windows 8.1.
Had this been some years ago, and I would say the page was relying on some ActiveX control to check the OS version, and that on error, "Windows 8.1" would be shown. Fortunately, even Microsoft seems to have abandoned ActiveX.
My Linux setup is now very offended because a web page called it names.
- mhurron 13y agoPerhaps they are simply assuming Windows 8.1 and everyone else have the best support for web standards and they only need to check if you are some other version of Windows in order to deal with them specifically. Or they only need to customize content based on Windows versions and if you're using the latest or something non-MS, you probably want to see stuff about the latest Windows version.
- gbl08ma 13y agoThat all makes sense if they were only determining the OS version for internal purposes, in order to filter the content as you said (still, it's great to let users know about it, otherwise people may get confused as to why they see different content on different machines/browsers). Since this is a public page, with the title "Which Windows operating system am I running?", I think the right thing to show when the user is not running Windows is, well, "You are not running Windows". That would clearly inform users, who may not be aware, of the fact that their OS is not Windows (and that, most likely, that website will have nothing to help them with using their current OS). Another alternative would be "Can't determine Windows version". Anyway, they way things are now, that page is definitely wrong.