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

Any plans to include ua-client-hints #12

Open
abrahamjuliot opened this issue Jun 13, 2020 · 2 comments
Open

Any plans to include ua-client-hints #12

abrahamjuliot opened this issue Jun 13, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@abrahamjuliot
Copy link

abrahamjuliot commented Jun 13, 2020

The ua-client-hints are currently in Chrome 84 and 85.

https://github.com/WICG/ua-client-hints#explainer-reducing-user-agent-granularity

Navigator.prototype.userAgentData
NavigatorUAData.prototype.getHighEntropyValues

await navigator.userAgentData.getHighEntropyValues(
  ["platform", "platformVersion", "architecture",  "model", "uaFullVersion"]
)
// returns
{
  architecture: "x86", 
  model: "", 
  platform: "Windows", 
  platformVersion: "10.0", 
  uaFullVersion: "85.0.4171.0"
}
@kdzwinel kdzwinel added the enhancement New feature or request label Jun 15, 2020
@kdzwinel
Copy link
Member

kdzwinel commented Jun 15, 2020

Thanks Abraham! That's a great idea and TBH I wasn't aware of the existence of JS API for CH. We should track it alongside the Accept-CH header. That being said, we are currently limited to tracking only APIs that are native to the browser and version of Chromium that this project is currently running (v78) doesn't yet have that API. Updating puppeteer won't help either as the latest officially supported Chromium version is v83 (https://github.com/puppeteer/puppeteer/releases).

We will add support for CH as soon as puppeteer supports Chromium 84. In the meantime though, researches interested in this data can get it by:

  1. Collecting Accept-CH header by listing it in the saveHeaders param of the request collector.
  2. Collecting JS APIs by adding them (Navigator.prototype.userAgentData and NavigatorUAData.prototype.getHighEntropyValues) to https://github.com/duckduckgo/tracker-radar-collector/blob/master/collectors/APICalls/breakpoints.js
  3. Forcing crawler to use Chromium 84+ via https://github.com/duckduckgo/tracker-radar-collector/blob/master/crawler.js#L43 .

Please note thought that running Chromium that's not officially supported by puppeteer is not guaranteed to work.

@abrahamjuliot
Copy link
Author

abrahamjuliot commented Jul 3, 2020

Just a quick update: as of Jun 26, due to site breakage, ua-client-hints are removed from 84 beta through 86 canary. Some versions of chromium currently still have it (Brave Nightly, etc.).

Due to site breakage, we decided to take a slow roll-out approach. Off-by-default would enable us to avoid incurring breakage on Enterprise users (who turn off Finch) as well as other embedders. @ 2264366

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

No branches or pull requests

2 participants