Windows 10 s detection from browser

I have a requirement to redirect the browser to a specific page when the client is running Windows 10 S (in particular, "S", just Win 10 is not enough). The user agent does not seem to indicate this.

I found solutions to get this data through C ++ and WMI on the client, but I need to run something like Javascript on the web page and conclude if the client has 10 S.

Any help in achieving this would be appreciated.

0
source share
2 answers

So, I just installed a new copy of Windows 10 S and launched its Edge browser by default (any other browser would have to be available through the Windows Store, as this is the only way to run applications on this release of Windows 10). window.navigator.userAgent in it was super similar to Windows 10 Pro, except for one tiny detail: something was called "ServiceUI 11" after OS information. I assume this will be a way to find out if the page is working in this release of Windows:

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

Tested on S and Pro in Edge and Chrome.

When trying in IE 11, although I have a different result. The line was "Mozilla / 5.0 (Windows NT 10.0, WOW64; Trident / 7.0; .NET4.0C ..."), and it was identical between S and Pro , so it seems that this method only works for modern browsers based on Gecko :)

+2
source

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

You can verify that the substring windows exist in the Detail platform or not with a specific version.

For example, var platformDetail = window.navigator.userAgent;

-1
source

Source: https://habr.com/ru/post/1269839/


All Articles