content-scope-scripts
content-scope-scripts copied to clipboard
Add Windows client hint brands override to match header we override natively
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 (https://github.com/duckduckgo/privacy-test-pages/pull/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:
- [x] I have tested this change locally
- [x] I have tested this change locally in all supported browsers
- [ ] This change will be visible to users
- [x] I have added automated tests that cover this change
- [x] I have ensured the change is gated by config
- [ ] This change was covered by a ship review
- [x] This change was covered by a tech design
- [ ] Any dependent config has been merged
[!NOTE] Introduces
uaChBrandsto overridenavigator.userAgentDatabrands to match Sec-CH-UA (with domain-specific overrides) and adds Playwright integration tests.
- Feature:
uaChBrands
- Intercepts
navigator.userAgentDatato overridebrandsandgetHighEntropyValues/fullVersionListoutputs to align with Sec-CH-UA.- Filters out
"Microsoft Edge WebView2", replaces"Microsoft Edge"with target brand (default"DuckDuckGo"), or appends target brand using Chromium version.- Supports domain-scoped overrides via
settings.domains(e.g., per-domain brand like"Netscape Navigator").- Enabled in Windows platform via
injected/src/features.js.- Tests
- New Playwright spec
integration-test/ua-ch-brands.spec.jscovering default and domain-specific overrides.- Test pages under
integration-test/test-pages/ua-ch-brands/**validatebrandsandfullVersionListmutations.- Playwright config updated to include the new spec for the
windowsproject.Written by Cursor Bugbot for commit 651637f2012cd74e40e980ca1295dba48a24f260. This will update automatically on new commits. Configure here.
- To see the specific tasks where the Asana app for GitHub is being used, see below:
- https://app.asana.com/0/0/1212017506660681
Deploy Preview for content-scope-scripts ready!
| Name | Link |
|---|---|
| Latest commit | fcbe6e8dadc7499961933f7469e3f6feddbc7484 |
| 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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Temporary Branch Update
The temporary branch has been updated with the latest changes. Below are the details:
- Branch Name: pr-releases/pr-2028
- Commit Hash: c9195bef41098400018ab9182a1b8b9eb90029e8
- Last Updated: November 27, 2025 at 4:06:12 PM UTC
- Install Command:
npm i github:duckduckgo/content-scope-scripts#c9195bef41098400018ab9182a1b8b9eb90029e8
Please use the above install command to update to the latest version.
[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