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

Fixes client hints UA to have invariable brand name. #15134

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

mkarolin
Copy link
Collaborator

@mkarolin mkarolin commented Sep 19, 2022

Fixes brave/brave-browser#25459

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

@mkarolin mkarolin self-assigned this Sep 19, 2022
@mkarolin mkarolin requested a review from a team as a code owner September 19, 2022 19:51
Brand product name is used in the UA client hint string, but on MacOS
our brand name varies based on the channel. This change assigns a fixed
product name for when constructing the UA client hint string.

Fixes brave/brave-browser#25459
@mkarolin
Copy link
Collaborator Author

Added a unit test.

@kjozwiak
Copy link
Member

kjozwiak commented Oct 4, 2022

Nightly channel (Desktop verification)

AllowCertainClientHintsStudy:Enabled (set as 50%)

Windows

Verification PASSED on Win 11 x64 using the following build(s):

Brave | 1.46.32 Chromium: 106.0.5249.91 (Official Build) nightly (64-bit)
-- | --
Revision | fa96d5f07b1177d1bf5009f647a5b8c629762157-refs/branch-heads/5249@{#707}
OS | Windows 11 Version 22H2 (Build 22621.521)

Launched 1.46.32 Chromium: 106.0.5249.91 using brave.exe --enable-logging=stderr --variations-server-url=https://variations.bravesoftware.com/seed and ensured the following:

sec-ch-ua: "Chromium";v="106", "Brave";v="106", "Not;A=Brand";v="99"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Example Example
hintsEnabledGriffin hintsEnabledDevTools

Linux

Verification PASSED on PopOS 22.04 x64 using the following build(s):

Brave | 1.46.32 Chromium: 106.0.5249.91 (Official Build) nightly (64-bit) 
--- | ---
Revision | fa96d5f07b1177d1bf5009f647a5b8c629762157-refs/branch-heads/5249@{#707}
OS | Linux

Launched 1.46.32 Chromium: 106.0.5249.91 using brave.exe --enable-logging=stderr --variations-server-url=https://variations.bravesoftware.com/seed and ensured the following:

sec-ch-ua: "Chromium";v="106", "Brave";v="106", "Not;A=Brand";v="99"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux"
Example Example
image clientHintsEnabled

macOS

Verification PASSED on macOS 12.6 Monterey x64 using the following build(s):

Brave | 1.46.32 Chromium: 106.0.5249.91 (Official Build) nightly (x86_64)
--- | ---
Revision | fa96d5f07b1177d1bf5009f647a5b8c629762157-refs/branch-heads/5249@{#707}
OS | macOS Version 12.6 (Build 21G115)

Launched 1.45.41 Chromium: 105.0.5195.102 using brave.exe --enable-logging=stderr --variations-server-url=https://variations.bravesoftware.com/seed and ensured the following:

sec-ch-ua: "Chromium";v="106", "Brave";v="106", "Not;A=Brand";v="99"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "macOS"
Example Example
Screen Shot 2022-10-04 at 1 27 58 PM Screen Shot 2022-10-04 at 1 28 10 PM

AllowCertainClientHintsStudy:Disabled (set as 50%)

Windows

Verification PASSED on Win 11 x64 using the following build(s):

Brave | 1.46.32 Chromium: 106.0.5249.91 (Official Build) nightly (64-bit)
-- | --
Revision | fa96d5f07b1177d1bf5009f647a5b8c629762157-refs/branch-heads/5249@{#707}
OS | Windows 11 Version 22H2 (Build 22621.521)

Launched 1.46.32 Chromium: 106.0.5249.91 using brave.exe --enable-logging=stderr --variations-server-url=https://variations.bravesoftware.com/seed and ensured the following:

  • ensured that sec-ch-ua, sec-ch-ua-mobile & sec-ch-platform weren't present via the Request Headers
Example Example
hintsDisabled hintsDisabledDevTools

Linux

Verification PASSED on PopOS 22.04 x64 using the following build(s):

Brave | 1.46.32 Chromium: 106.0.5249.91 (Official Build) nightly (64-bit)
--- | ---
Revision | fa96d5f07b1177d1bf5009f647a5b8c629762157-refs/branch-heads/5249@{#707}
OS | Linux

Launched 1.46.32 Chromium: 106.0.5249.91 using brave.exe --enable-logging=stderr --variations-server-url=https://variations.bravesoftware.com/seed and ensured the following:

  • ensured that sec-ch-ua, sec-ch-ua-mobile & sec-ch-platform weren't present via the Request Headers
Example Example
image linuxDisabled

macOS

Verification PASSED on macOS 12.5.1 Monterey x64 using the following build(s):

Brave | 1.46.32 Chromium: 106.0.5249.91 (Official Build) nightly (x86_64) 
--- | ---
Revision | fa96d5f07b1177d1bf5009f647a5b8c629762157-refs/branch-heads/5249@{#707}
OS | macOS Version 12.6 (Build 21G115)

Launched 1.46.32 Chromium: 106.0.5249.91 using brave.exe --enable-logging=stderr --variations-server-url=https://variations.bravesoftware.com/seed and ensured the following:

  • ensured that sec-ch-ua, sec-ch-ua-mobile & sec-ch-platform weren't present via the Request Headers
Example Example
Screen Shot 2022-10-04 at 1 46 57 PM Screen Shot 2022-10-04 at 1 47 24 PM

@kjozwiak
Copy link
Member

kjozwiak commented Oct 4, 2022

Nightly channel (Android/Mobile verification)

AllowCertainClientHintsStudy:Enabled (set as 50%)

Verification PASSED on Samsung S10+ running Android 12 using the following build(s):

Brave | 1.46.32 Chromium: 106.0.5249.91 (Official Build) canary (32-bit)
--- | ---
Revision | fa96d5f07b1177d1bf5009f647a5b8c629762157-refs/branch-heads/5249@{#707}
OS | Android 12; Build/SP1A.210812.016

Launched 1.46.32 Chromium: 106.0.5249.91 using the instructions outlined via #10408 (comment) and ensured the following:

sec-ch-ua: "Chromium";v="106", "Brave";v="106", "Not;A=Brand";v="99"
sec-ch-ua-mobile: ?1
sec-ch-ua-platform: "Android"
Example Example
Screenshot_20221004-145357_Brave - Nightly androidDevToolsEnabled

AllowCertainClientHintsStudy:Disabled (set as 50%)

Verification PASSED on Samsung S10+ running Android 12 using the following build(s):

Brave | 1.46.32 Chromium: 106.0.5249.91 (Official Build) canary (32-bit)
--- | ---
Revision | fa96d5f07b1177d1bf5009f647a5b8c629762157-refs/branch-heads/5249@{#707}
OS | Android 12; Build/SP1A.210812.016

Launched 1.46.32 Chromium: 106.0.5249.91 using the instructions outlined via #10408 (comment) and ensured the following:

  • ensured that sec-ch-ua, sec-ch-ua-mobile & sec-ch-platform weren't present via the Request Headers
Example Example
Screenshot_20221004-144539_Brave - Nightly androidDevToolsDisabled

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

Successfully merging this pull request may close these issues.

sec-ch-ua client hint should use the same product name regardless of the channel.
4 participants