Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

windows 11 version is wrong #198

Open
ruoshuiyx opened this issue May 21, 2022 · 3 comments
Open

windows 11 version is wrong #198

ruoshuiyx opened this issue May 21, 2022 · 3 comments

Comments

@ruoshuiyx
Copy link

$version = $agent->version($platform);
it is 10.0,
but my computer is windows 11

@mdobydullah
Copy link

$version = $agent->version($platform); it is 10.0, but my computer is windows 11

Same issue.

@Khuthaily
Copy link

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.

@ruoshuiyx
Copy link
Author

thianks ,I also use this

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@Khuthaily @mdobydullah @ruoshuiyx and others