You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if there is a way to detect Windows 11 at the server level (yet). Based on my Microsoft, we can detect Windows 11 from with JavaScript (see code below). I tweaked their code to send the version to the server via AJAX (as a POST method). It has been working fine for for me.
navigator.userAgentData.getHighEntropyValues(["platformVersion"])
.then(ua => {
if (navigator.userAgentData.platform === "Windows") {
const majorPlatformVersion = parseInt(ua.platformVersion.split('.')[0]);
if (majorPlatformVersion >= 13) {
console.log("Windows 11 or later");
}
else if (majorPlatformVersion > 0) {
console.log("Windows 10");
}
else {
console.log("Before Windows 10");
}
}
else {
console.log("Not running on Windows");
}
});
If someone has a better approach via PHP, please share.
$version = $agent->version($platform);
it is 10.0,
but my computer is windows 11
The text was updated successfully, but these errors were encountered: