From 959ce57c58510e5b08f5c4643d95b82c7121ceea Mon Sep 17 00:00:00 2001 From: laghee <20972610+laghee@users.noreply.github.com> Date: Tue, 2 Dec 2025 19:28:22 +0100 Subject: [PATCH 01/10] Add ua-ch-brands feature --- features/ua-ch-brands.json | 7 +++++++ index.js | 1 + 2 files changed, 8 insertions(+) create mode 100644 features/ua-ch-brands.json diff --git a/features/ua-ch-brands.json b/features/ua-ch-brands.json new file mode 100644 index 000000000..2aa6c5f6b --- /dev/null +++ b/features/ua-ch-brands.json @@ -0,0 +1,7 @@ +{ + "_meta": { + "description": "User agent client hint brands for the browser JavaScript API." + }, + "state": "disabled", + "exceptions": [] +} diff --git a/index.js b/index.js index 1b7c8f71b..ba8dda263 100644 --- a/index.js +++ b/index.js @@ -144,6 +144,7 @@ const featuresToIncludeTempUnprotectedExceptions = [ 'trackingCookies1p', 'trackingCookies3p', 'trackingParameters', + 'uaChBrands', 'unprotectedTemporary', 'webCompat', ]; From eeeb5d9993b8e0c58d1fcb2593912374204e9309 Mon Sep 17 00:00:00 2001 From: laghee <20972610+laghee@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:12:12 +0100 Subject: [PATCH 02/10] Lint --- overrides/windows-override.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/overrides/windows-override.json b/overrides/windows-override.json index e7f9bf358..7fbeb33c5 100644 --- a/overrides/windows-override.json +++ b/overrides/windows-override.json @@ -2541,6 +2541,9 @@ "clientBrandHint": { "state": "enabled" }, + "uaChBrands": { + "state": "enabled" + }, "privacyPro": { "state": "enabled", "features": { From 2485429ffcb7bdee26b65fbadeb07dd19c0179ee Mon Sep 17 00:00:00 2001 From: laghee <20972610+laghee@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:30:32 +0100 Subject: [PATCH 03/10] Add schema --- schema/config.ts | 2 ++ schema/features/ua-ch-brands.ts | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 schema/features/ua-ch-brands.ts diff --git a/schema/config.ts b/schema/config.ts index 5a74a10fc..3abcd2487 100644 --- a/schema/config.ts +++ b/schema/config.ts @@ -24,6 +24,7 @@ import { Taskbar } from './features/taskbar'; import { AppHealth } from './features/appHealth'; import { ElementHidingFeature } from './features/element-hiding'; import { RequestBlocklistFeature } from './features/request-blocklist'; +import { UaChBrandsFeature } from './features/ua-ch-brands'; export { WebCompatSettings } from './features/webcompat'; export { DuckPlayerSettings } from './features/duckplayer'; @@ -72,6 +73,7 @@ export type ConfigV5 = { customUserAgent?: CustomUserAgentFeature; elementHiding?: ElementHidingFeature; requestBlocklist?: RequestBlocklistFeature; + uaChBrands?: UaChBrandsFeature; }; unprotectedTemporary: SiteException[]; }; diff --git a/schema/features/ua-ch-brands.ts b/schema/features/ua-ch-brands.ts new file mode 100644 index 000000000..9b081190f --- /dev/null +++ b/schema/features/ua-ch-brands.ts @@ -0,0 +1,13 @@ +import { CSSInjectFeatureSettings, Feature } from '../feature'; + +type StateToggle = 'enabled' | 'disabled'; + +type UaChBrandsSettings = CSSInjectFeatureSettings<{ + // Defaults to enabled when feature state is enabled + filterWebView2?: StateToggle; + // Defaults to enabled when feature state is enabled + overrideEdge?: StateToggle; +}>; + +export type UaChBrandsFeature = Feature; + From ab135de795293abe70dcf70e2050668656016fb2 Mon Sep 17 00:00:00 2001 From: laghee <20972610+laghee@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:46:32 +0100 Subject: [PATCH 04/10] Zap extraneous comments --- schema/features/ua-ch-brands.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/schema/features/ua-ch-brands.ts b/schema/features/ua-ch-brands.ts index 9b081190f..ceebee318 100644 --- a/schema/features/ua-ch-brands.ts +++ b/schema/features/ua-ch-brands.ts @@ -3,9 +3,7 @@ import { CSSInjectFeatureSettings, Feature } from '../feature'; type StateToggle = 'enabled' | 'disabled'; type UaChBrandsSettings = CSSInjectFeatureSettings<{ - // Defaults to enabled when feature state is enabled filterWebView2?: StateToggle; - // Defaults to enabled when feature state is enabled overrideEdge?: StateToggle; }>; From 82a6f5b136bd56a19602894e8b34bf65df09aaaf Mon Sep 17 00:00:00 2001 From: laghee <20972610+laghee@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:54:02 +0100 Subject: [PATCH 05/10] Liiint --- schema/features/ua-ch-brands.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/schema/features/ua-ch-brands.ts b/schema/features/ua-ch-brands.ts index ceebee318..36ef3acea 100644 --- a/schema/features/ua-ch-brands.ts +++ b/schema/features/ua-ch-brands.ts @@ -8,4 +8,3 @@ type UaChBrandsSettings = CSSInjectFeatureSettings<{ }>; export type UaChBrandsFeature = Feature; - From c7e4657e920d72679f7a3c74b87e31523a05ca3e Mon Sep 17 00:00:00 2001 From: laghee <20972610+laghee@users.noreply.github.com> Date: Tue, 9 Dec 2025 17:48:11 +0100 Subject: [PATCH 06/10] Gate to internal & preview channels --- overrides/windows-override.json | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/overrides/windows-override.json b/overrides/windows-override.json index 33d574e3b..0aef23f66 100644 --- a/overrides/windows-override.json +++ b/overrides/windows-override.json @@ -2546,7 +2546,36 @@ "state": "enabled" }, "uaChBrands": { - "state": "enabled" + "state": "enabled", + "settings": { + "additionalCheck": "disabled", + "conditionalChanges": [ + { + "condition": { + "internal": true + }, + "patchSettings": [ + { + "op": "replace", + "path": "/additionalCheck", + "value": "enabled" + } + ] + }, + { + "condition": { + "preview": true + }, + "patchSettings": [ + { + "op": "replace", + "path": "/additionalCheck", + "value": "enabled" + } + ] + } + ] + } }, "privacyPro": { "state": "enabled", From 9d3befa793765d5196329b33562a5d6530b3c49a Mon Sep 17 00:00:00 2001 From: laghee <20972610+laghee@users.noreply.github.com> Date: Tue, 9 Dec 2025 17:56:52 +0100 Subject: [PATCH 07/10] Merge conditions into 1 --- overrides/windows-override.json | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/overrides/windows-override.json b/overrides/windows-override.json index 0aef23f66..b2b72cef4 100644 --- a/overrides/windows-override.json +++ b/overrides/windows-override.json @@ -2551,21 +2551,9 @@ "additionalCheck": "disabled", "conditionalChanges": [ { - "condition": { - "internal": true - }, - "patchSettings": [ - { - "op": "replace", - "path": "/additionalCheck", - "value": "enabled" - } - ] - }, - { - "condition": { - "preview": true - }, + "condition": [ + { "internal": true }, + { "preview": true }], "patchSettings": [ { "op": "replace", From a1891b1843a9a8eb34c3d60dad6201d245394e13 Mon Sep 17 00:00:00 2001 From: laghee <20972610+laghee@users.noreply.github.com> Date: Tue, 9 Dec 2025 18:02:32 +0100 Subject: [PATCH 08/10] Fix angry test --- schema/features/ua-ch-brands.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schema/features/ua-ch-brands.ts b/schema/features/ua-ch-brands.ts index 36ef3acea..74a219252 100644 --- a/schema/features/ua-ch-brands.ts +++ b/schema/features/ua-ch-brands.ts @@ -1,10 +1,11 @@ -import { CSSInjectFeatureSettings, Feature } from '../feature'; +import { CSSInjectFeatureSettings, Feature, FeatureState } from '../feature'; type StateToggle = 'enabled' | 'disabled'; type UaChBrandsSettings = CSSInjectFeatureSettings<{ filterWebView2?: StateToggle; overrideEdge?: StateToggle; + additionalCheck?: FeatureState; }>; export type UaChBrandsFeature = Feature; From 8e28ce5851d091dbe541a468228ff8f12f63ba85 Mon Sep 17 00:00:00 2001 From: laghee <20972610+laghee@users.noreply.github.com> Date: Tue, 9 Dec 2025 18:34:00 +0100 Subject: [PATCH 09/10] Experiment w/ swtiching syntax --- schema/feature.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schema/feature.ts b/schema/feature.ts index ddedb09fb..c9e48643a 100644 --- a/schema/feature.ts +++ b/schema/feature.ts @@ -65,6 +65,7 @@ type ConditionBlock = { minSupportedVersion?: number; maxSupportedVersion?: number; internal?: boolean; + preview?: boolean; context?: { top?: boolean; frame?: boolean; @@ -79,7 +80,7 @@ type CSSInjectFeatureSettingsPatches = { patchSettings: Operation[]; }[]; conditionalChanges?: { - condition: ConditionBlock | ConditionBlock[]; + condition: ConditionBlock | Array; patchSettings: Operation[]; }[]; }; From 3aa170bdbec4fbc6434dfff4d8dcfc7c43c20cce Mon Sep 17 00:00:00 2001 From: laghee <20972610+laghee@users.noreply.github.com> Date: Tue, 9 Dec 2025 18:45:49 +0100 Subject: [PATCH 10/10] Annnnd that was not the problem it seems --- schema/feature.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/feature.ts b/schema/feature.ts index c9e48643a..1a8776fd9 100644 --- a/schema/feature.ts +++ b/schema/feature.ts @@ -80,7 +80,7 @@ type CSSInjectFeatureSettingsPatches = { patchSettings: Operation[]; }[]; conditionalChanges?: { - condition: ConditionBlock | Array; + condition: ConditionBlock | ConditionBlock[]; patchSettings: Operation[]; }[]; };