Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feedback: "Detect Windows 11 and CPU architecture using User-Agent Client Hints" #2579

Open
khelkun opened this issue May 5, 2023 · 14 comments
Labels
ADO cat: webplatform Web Platform-related content.

Comments

@khelkun
Copy link

khelkun commented May 5, 2023

About this part fo the documentation, here is my usage about Hololens detection from Edge:

Afaik Windows platform version is 12.0.0 for "Windows Holographic for Business" which is the current Hololens 2 Windows edition.

Actually the values in "Detecting specific Windows versions" are not accurate. For example my Windows 21H2 Desktop as a value equal to 10.0.0 for navigator.userAgentData.getHighEntropyValues(["platformVersion"]) .then(r => r.platformVersion).
Also documenting the Hololens Windows edition would be nice: 12.0.0 for Hololens 2. What about Hololens 1 (11.0.0 ?). What about Windows phones ?


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

AB#44527596

@captainbrosset captainbrosset added cat: webplatform Web Platform-related content. and removed triage-needed labels May 5, 2023
@captainbrosset
Copy link
Contributor

Thank you for reporting the inaccuracy. Let me make sure this is tracked by the team.

@khelkun
Copy link
Author

khelkun commented Oct 5, 2023

Apparently the latest Windows platform on Hololens 2 is now 15.0.0. Is it also the case for the Windows 11 desktop (no hololens platform). I'm currently relying on this platform version to detect edge is running on hololens, because since some version 112+ of Edge the user agent of Edge is the same for the Windows Hololens 2 platform and the regular Windows Desktop platform.

However 15.0.0 is also the platform version when using Edge on the latest Windows 11 on a Desktop (Microsoft Surface), so I'm not able to detect Edge is running on Hololens from the HTTP headers anymore.

@captainbrosset
Copy link
Contributor

Thank you for the additional detail on this. We have, unfortunately, not been able to work on this issue since you filed it, but this is very useful information. We'll keep it in mind when we find the time to tackle this issue.

@khelkun
Copy link
Author

khelkun commented Oct 5, 2023

@captainbrosset
I'm a bit deperate here to be honest: I've seek the web browser API and the HTTP headers, but I cannot find a single relevant difference between Edge running on a regular Windows 11 laptop up to date, and Edge running on Hololens 2 up to date.
Any help would be very nice.

Well the latest Edge version on Hololens 2 is 117.0.2045.43 while the Edge version on a regular laptop Windows 11 up to date is 117.0.2045.47. But relying on the "117.0.2045.43" version as a condition for "I'm Edge running on Hololens 2" is not a solution.

@captainbrosset
Copy link
Contributor

Let me try to see if I can get you an answer.

@captainbrosset
Copy link
Contributor

One thought, although I don't have a hololens device to test, is to test for WebXR support. There might be differences in how the API is implemented/supported across devices. Would the XRInputSource.hand property be available for example?

@khelkun
Copy link
Author

khelkun commented Oct 6, 2023

One thought, although I don't have a hololens device to test, is to test for WebXR support. There might be differences in how the API is implemented/supported across devices. Would the XRInputSource.hand property be available for example?

That's a possible option, but Edge exists on Android smartphones which would probably have WebXR support. And I wonder if latest Microsoft Surface devices also support WebXR on Edge.

But testing for XRInputSource.hand property could be a way to go, you're right. I'm gonna check that on Hololens, and hopr this is not supported by some Android devices and Microsoft Surface devices.

@captainbrosset
Copy link
Contributor

Another lead, open https://webglreport.com/?v=2 on both devices and see if there are ways to differentiate the platform.

@khelkun
Copy link
Author

khelkun commented Oct 6, 2023

Apparently XRInputSource.hand is not supported by any browser yet including Edge

@khelkun
Copy link
Author

khelkun commented Oct 6, 2023

This OVR_multiview extension (and OVR_multiview2) is about stereo rendering, e.g per eye rendering, and could have been an option. But it's supported by chrome web browser on my workstation, so it's not an option.

An Edge extension may allow my website to detect it's browsed from Edge on Hololens by using some part of the extension API, for example the enterprise_hardwarePlatform which is supported according to the Edge documentation. It would not be an ideal solution but better than nothing.

Still I'm a bit confused about the user agent: is it possible for Edge to have a distinct user agent on Hololens? There was a difference before version 112.

@khelkun
Copy link
Author

khelkun commented Oct 24, 2023

@captainbrosset any distinction in the HTTP header sent by Hololens Edge would be very nice.

Indeed I really have no other solution than developing an Edge extension to detect it runs from Hololens. For example any specific string like "Hololens Edge";"v=99" in the SEC-CH-UA HTTP header would allow to identify it's Edge for Hololens.

@captainbrosset
Copy link
Contributor

@khelkun taking a step back, I never asked why you needed to detect Edge running on Hololens in the first place. It's usually much better to detect the presence of a feature on the web vs. detecting a particular device type. I assume that's not an option for you, but would love to understand why.

@khelkun
Copy link
Author

khelkun commented Oct 26, 2023

@captainbrosset sorry that I've not explained that in the first place (I thought I did). We have a web portal in which you can click and open a 3D asset viewer implemented as a web app:

  • When you use the web portal from a regular platform like a Windows Desktop workstation, it opens the 3D asset viewer in the web browser.
  • When you use the web portal from Edge in Hololens, then I use a custom URL protocolmy-hololens-3d-viewer:// to auto detect the user is using hololens and so forth launch our own Hololens 3D viewer application instead of opening the regular web viewer in Edge.

Sure, we could somehow put 2 distinct controls (buttons) to let the user choose to launch the web viewer or the hololens viewer in the web portal, but that's not nice, plus the fact that there's many places and shortcuts in the web portal to launch the viewer. So this alternative is not very user friendly in terms of UX.

@captainbrosset
Copy link
Contributor

Good news. I'm not sure when this will be available in Edge (in theory, should be the next Canary build), but we're adding a new user agent model value for HoloLens.

This means that this code:

navigator.userAgentData.getHighEntropyValues(["model"]).then(values => {
  console.log(values.model);
});

Will now print Holographic (this is in line with Xbox, where the code would print Xbox).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADO cat: webplatform Web Platform-related content.
Projects
None yet
Development

No branches or pull requests

2 participants