Skip to content Skip to sidebar Skip to footer

Detect Windows 10 S From The Browser

I have a requirement to redirect a browser to a particular page when the client is running Windows 10 S (specifically 'S', just Win 10 isn't sufficient). The user agent doesn't see

Solution 1:

So I just installed a fresh copy of Windows 10 S and ran its default browser Edge (any other browser would have to be available through Windows Store as it is the only way to run apps on this edition of Windows 10). The window.navigator.userAgent in it was super similar to that of Windows 10 Pro except one tiny detail: something called "ServiceUI 11" after the OS info. My guess is that this would be the way for you to find out if the page is running on that particular edition of Windows:

function isWindows10S(){
  return window.navigator.userAgent.indexOf("ServiceUI") !== -1;
}

Tested it on S and Pro in Edge and Chrome.

When tried in IE 11 though I've got a different result. The string was "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C..." and it was identical between the S and Pro so looks like that method only works for modern browsers that are based on Gecko :)


Solution 2:

In JavaScript, you can use navigator API of window Object which will return you with a string of complete details like "appCodeName/appVersion number (Platform; Security; OS-or-CPU; Localization; rv: revision-version-number) product/productSub Application-Name Application-Name-version"

You can check the substring windows exist in the platformDetail or not with the specific version.

For e.g. var platformDetail = window.navigator.userAgent;


Post a Comment for "Detect Windows 10 S From The Browser"