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

Split up UA-Bitness hint into 2 #217

Closed
miketaylr opened this issue Mar 23, 2021 · 14 comments
Closed

Split up UA-Bitness hint into 2 #217

miketaylr opened this issue Mar 23, 2021 · 14 comments
Labels
enhancement New feature or request needs-use-cases

Comments

@miketaylr
Copy link
Collaborator

Thinking more about the use-cases for "bitness" (see #105), it seems desirable to not only know platform bitness, but also the app bitness. For example, if you run an app store webpage, or a support page for an app, you can know if a user has downloaded the most optimized binary, or is in some other "32bit app on 64bit OS" bucket (aka "WOW64").

These 2 hints (UA-App-Bitness? / UA-Client-Bitness? & UA-Platform-Bitness) would be high-entropy hints and not available by default.

@miketaylr miketaylr self-assigned this Mar 23, 2021
@bat999
Copy link

bat999 commented Mar 23, 2021

Hi
The User Agent string doesn't make reference to bitness with my Android phone.
So I would hope to see "" for any bitness-related User Agent Client Hints.
Same as with Sec-CH-UA-Arch: ""
(Just sayin')

@cpeterso
Copy link

Firefox's UA used to expose both the browser and platform bitness, e.g. Windows NT 10.0; WOW64 and Linux i686 on x86_64. The browser bitness (in Firefox bug 265536) was originally added so Mozilla's Plugin Finder Service could offer a 32-bit NPAPI plugins to 32-bit Firefox browser even if it was running on a 64-bit OS. (A 32-bit Firefox could not load a 64-bit plugin.)

I don't believe there is still any use case for exposing the browser bitness. No major browser still supports Flash or other NPAPI plugins and Adobe's Flash installer has bundled both 32- and 64-bit plugins for years. If a user is running a 64-bit OS, they probably would like to be offered 64-bit app installers, even if they are running a 32-bit browser for some reason. As such, I removed the browser bitness from Firefox's UA string in Firefox 69 (bug 1559747), exposing just the platform bitness.

@miketaylr
Copy link
Collaborator Author

The User Agent string doesn't make reference to bitness with my Android phone.
So I would hope to see "" for any bitness-related User Agent Client Hints.

I agree that bitness shouldn't be sent by default, but I think there are valid use cases for making it available. The spec has a carve-out for this if a browser wanted to withhold that information for privacy reasons:

User agents MAY return the empty string or a fictitious value for full version, platform architecture, platform bitness or model, for privacy, compatibility, or other reasons.

@bslassey
Copy link

I think this is something where we can wait until we have concrete and compelling use-cases (and I suspect the use cases would be pretty niche). Two come to mind, first I could imagine that media codec selection. I can also see browser support forums (and bug trackers) making use of this information.

@miketaylr miketaylr added the enhancement New feature or request label Apr 9, 2021
@miketaylr miketaylr removed their assignment Apr 9, 2021
@miketaylr
Copy link
Collaborator Author

I think this is something where we can wait until we have concrete and compelling use-cases (and I suspect the use cases would be pretty niche).

Yeah, agree. Let's park this for now and reconsider once we're sure it unlocks important use cases.

@miketaylr
Copy link
Collaborator Author

Documenting this relevant tweet:

https://twitter.com/makoto_kato/status/1381824750129872901

When looking crash data of Fenix, Most crashes are Android ABI is 64-bit, but Fenix build is 32-bit. Why do Fenix users 32-bit build on 64-bit device?

@bonmotbot
Copy link

We have a use case of the browser bitness in Google Meet. We turn off some features on 32-bit browsers because the performance isn't good enough without 64-bit SIMD instructions. Without the browser bitness hint, we won't be able to make that distinction anymore, or to detect its impact in future performance analysis.

@jesup
Copy link

jesup commented Jul 2, 2021

You can directly test the speed of whatever SIMD operation I presume. It depends I suppose on what is slow on 32-bit. Scaling? Image analysis? If you can test the operation speed itself, you don't need to know the architecture. Also, in theory a browser might not optimize the case you care about on a 64-bit system, so 32 vs 64 may not be what you need.

In general, testing if something is implemented, or testing if it's fast enough on the system you're actually on, is better than any form of sniffing.

If this is hidden deep in Meet, and you don't know what the slow operation is, then sniffing is iffy anyways - and the Meet implementation might change tomorrow, so your sniffing may be wrong then.

Of course, Meet is the code that should be running these runtime acceptance tests, not some site using meet.

@bonmotbot
Copy link

Just to be clear, I'm reporting this use case on behalf of Google Meet, not trying to use Meet in another site.

Currently, we check for a 32-bit browser and disable some features, since we know they won't work well. The check lets us notify the user why the feature isn't supported and link to a help article:
https://support.google.com/meet/answer/10058482?expand_all_zippies=true#requirements&zippy=%2Cwhy-cant-i-use-the-change-background-option

It also allows us to avoid downloading a ~7MB wasm binary, which implements the unsupported features.

Without the browser bitness check, we can't really tease this case out from other sources of slowness. We'd have to let users download the extra code and let it work poorly, when we could have prevented that ahead of time.

Of the 32-bit browser usages we see currently, about half are on 64-bit OS, so this is a real segment of users.

@miketaylr
Copy link
Collaborator Author

Thinking about this some more, I think it's useful to make the transition from the UA string to UA-CH as seamless as possible, for browsers that exposed app bitness as WoW64 (obviously browsers that don't do not have any requirements to start exposing it) - even if we aren't aware of sites relying on this (we do know of Meet, but there's a vast audience of sites and devs out there who aren't looking at this issue to reply with use cases).

I don't think we need to expose the actual binary bitness, if backwards compat is the goal, but we can just add a hint that returns a boolean for "wow64-ness".

@cpeterso
Copy link

I don't think we need to expose the actual binary bitness, if backwards compat is the goal, but we can just add a hint that returns a boolean for "wow64-ness".

Firefox added app bitness to its UA so NPAPI plugin installation sites could differentiate between Win64 and WoW64 browsers. WoW64 Firefox didn't support 64-bit plugins. But now that Firefox no longer supports NPAPI plugins, Firefox reports Win64 for both Win64 and WoW64 browsers.

we aren't aware of sites relying on this (we do know of Meet, but there's a vast audience of sites and devs out there who aren't looking at this issue to reply with use cases).

@miketaylr - Does Meet differentiate between Win64 and WoW64 browsers? Do you have any more information you can share about Meet's 64-bit checks?

@miketaylr
Copy link
Collaborator Author

Does Meet differentiate between Win64 and WoW64 browsers? Do you have any more information you can share about Meet's 64-bit checks?

@cpeterso I'm not super familiar with the code, but perhaps @bonmotbot would know.

miketaylr added a commit to miketaylr/ua-client-hints that referenced this issue Jan 18, 2022
miketaylr added a commit to miketaylr/ua-client-hints that referenced this issue Jan 18, 2022
miketaylr added a commit to miketaylr/ua-client-hints that referenced this issue Jan 18, 2022
(sorry, can't help myself)
@bonmotbot
Copy link

The distinction between WoW64 and Win64 is used to disable features mentioned above. They're only supported on 64-bit browsers, which includes Win64, but not WoW64.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 7, 2022
…eport Windows 10 as "x86"). r=hsivonen,necko-reviewers,dragana

Windows 11+ supports x86_64 emulation, but Windows 10 only supports x86 emulation.

Advantages of reporting ARM64 Windows 11+ as x86_64:

* Sites that offer software downloads will know that the client is capable of running x86_64 software.

* Reduced fingerprinting entropy because ARM64 Windows 11+ users' UA string will match the UA string of the ~80% of Windows Firefox users running x86_64 instead of the ~20% running x86.

* Some sites disable features for 32-bit clients, such as Google Meet requiring 64-bit to use wasm visual effects:

WICG/ua-client-hints#217 (comment)

https://support.google.com/meet/answer/10058482?expand_all_zippies=true#requirements&zippy=%2Cwhy-cant-i-use-the-change-background-option%2Crequirements-to-apply-visual-effects-on-computer

The browser_navigator.js test is not actually run on ARM64 Windows in automation, but these test changes would make the test pass on ARM64 Windows 10 and 11 if this test ever is run.

Differential Revision: https://phabricator.services.mozilla.com/D143010
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Apr 7, 2022
…eport Windows 10 as "x86"). r=hsivonen,necko-reviewers,dragana

Windows 11+ supports x86_64 emulation, but Windows 10 only supports x86 emulation.

Advantages of reporting ARM64 Windows 11+ as x86_64:

* Sites that offer software downloads will know that the client is capable of running x86_64 software.

* Reduced fingerprinting entropy because ARM64 Windows 11+ users' UA string will match the UA string of the ~80% of Windows Firefox users running x86_64 instead of the ~20% running x86.

* Some sites disable features for 32-bit clients, such as Google Meet requiring 64-bit to use wasm visual effects:

WICG/ua-client-hints#217 (comment)

https://support.google.com/meet/answer/10058482?expand_all_zippies=true#requirements&zippy=%2Cwhy-cant-i-use-the-change-background-option%2Crequirements-to-apply-visual-effects-on-computer

The browser_navigator.js test is not actually run on ARM64 Windows in automation, but these test changes would make the test pass on ARM64 Windows 10 and 11 if this test ever is run.

Differential Revision: https://phabricator.services.mozilla.com/D143010
@mehagar
Copy link

mehagar commented Nov 29, 2023

@miketaylr , following up our conversation elsewhere, there is a use case for having Chrome OS reveal whether or not they are running on 32-bit Chrome OS or 64-bit Chrome OS (where the architecture of the CPU itself is 64-bit for both). The Zoom web app currently handles 32-bit Chrome OS (and Windows 32-bit Chrome, for that matter) differently by changing how WebAssembly memory is allocated, due to memory constraints on those 32-bit applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-use-cases
Projects
None yet
Development

No branches or pull requests

7 participants