UI: Implement JavaScript getOS function Windows platform architecture detection #104136

Merged
Márton Lente merged 15 commits from get-os-win-arm into main 2024-11-08 12:03:41 +01:00
Showing only changes of commit dfda0ac999 - Show all commits

View File

@ -6,7 +6,7 @@
*/ */
async function getOS() { async function getOS() {
// Init variable OS default // Init variable OS default
var OS = "windows"; let OS = "windows";
function getOSPlaformVersion() { function getOSPlaformVersion() {
//MacOS, MacOS X, macOS //MacOS, MacOS X, macOS
@ -72,7 +72,7 @@ async function getOS() {
* https://learn.microsoft.com/en-us/microsoft-edge/web-platform/how-to-detect-win11#sample-code-for-detecting-arm-or-x86 * https://learn.microsoft.com/en-us/microsoft-edge/web-platform/how-to-detect-win11#sample-code-for-detecting-arm-or-x86
*/ */
// Wait for and get the high entropy values from async method // Wait for and get the high entropy values from async method
var ua = await navigator.userAgentData.getHighEntropyValues(["architecture", "bitness"]); let ua = await navigator.userAgentData.getHighEntropyValues(["architecture", "bitness"]);
// Check if the platform is Windows // Check if the platform is Windows
if (navigator.userAgentData.platform === "Windows") { if (navigator.userAgentData.platform === "Windows") {