Skip to content

Instantly share code, notes, and snippets.

@daybrush
Created September 1, 2020 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daybrush/0308b8015f45b6a7dad2444b061dbfe0 to your computer and use it in GitHub Desktop.
Save daybrush/0308b8015f45b6a7dad2444b061dbfe0 to your computer and use it in GitHub Desktop.
navigator_id.cc (freeze userAgent)
String NavigatorID::platform() const {
// If the User-Agent string is frozen, platform should be a value
// matching the frozen string per https://github.com/WICG/ua-client-hints. See
// content::frozen_user_agent_strings.
if (base::FeatureList::IsEnabled(features::kFreezeUserAgent)) {
#if defined(OS_ANDROID)
// Matches the frozen mobile User-Agent string (arbitrary Android device).
return "Linux armv8l";
#else
// Matches the frozen desktop User-Agent string (Windows).
return "Win32";
#endif
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment