Skip to content

Conversation

@laghee
Copy link
Contributor

@laghee laghee commented Oct 21, 2025

Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/72649045549333/task/1208581002806545?focus=true

Description

Adding an override for our client hints brands in the JS API to match those we send in the Sec-CH-UA header and resolve breakage caused by current inconsistency between the two.

Testing Steps

Use privacy test page (duckduckgo/privacy-test-pages#356) on WebView2 build from this branch of C-S-S
OR
Manually compare Sec-Ch-Ua header brands with output of navigator.userAgentData.brands and navigator.userAgentData.getHighEntropyValues(['brands'])

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Note

Introduces uaChBrands to align navigator.userAgentData brands with Sec-CH-UA (with domain overrides and Edge/WebView2 handling) and adds Windows integration tests and pages.

  • Feature:
    • Add uaChBrands content feature (injected/src/features/ua-ch-brands.js) to:
      • Filter Microsoft Edge WebView2 and replace/append Microsoft Edge with a target brand (default DuckDuckGo).
      • Support domain-specific brand via brandName setting (e.g., through conditionalChanges).
      • Override navigator.userAgentData.brands and adjust getHighEntropyValues(['brands','fullVersionList']) accordingly.
    • Enable uaChBrands in feature registries (injected/src/features.js) for Windows and integration.
  • Tests:
    • Add Playwright spec integration-test/ua-ch-brands.spec.js and wire into Windows project (playwright.config.js).
    • Add test pages verifying brand override, domain override, and overrideEdge disabled cases.
    • Add corresponding test configs in test-pages/ua-ch-brands/config/*.

Written by Cursor Bugbot for commit fcbe6e8. This will update automatically on new commits. Configure here.


@netlify
Copy link

netlify bot commented Oct 21, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit fcbe6e8
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/692876cf96deca000859f2d0
😎 Deploy Preview https://deploy-preview-2028--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

github-actions bot commented Oct 21, 2025

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

@github-actions
Copy link

github-actions bot commented Oct 21, 2025

[Beta] Generated file diff

Time updated: Thu, 27 Nov 2025 16:06:27 GMT

Android
    - android/adsjsContentScope.js
  • android/autofillImport.js
  • android/brokerProtection.js
  • android/contentScope.js

File has changed

Apple
    - apple/contentScope.js
  • apple/contentScopeIsolated.js

File has changed

Chrome-mv3
    - chrome-mv3/inject.js

File has changed

Firefox
    - firefox/inject.js

File has changed

Integration
    - integration/contentScope.js

File has changed

Windows
    - windows/contentScope.js

File has changed

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@laghee laghee added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit 9561b9c Nov 27, 2025
18 checks passed
@laghee laghee deleted the km/add-ch-brand-shim branch November 27, 2025 16:30
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.

2 participants