Skip to content

Add env_brave preparser token - #2

Open
ryanbr wants to merge 1 commit into
masterfrom
env-brave
Open

Add env_brave preparser token#2
ryanbr wants to merge 1 commit into
masterfrom
env-brave

Conversation

@ryanbr

@ryanbr ryanbr commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Adds an env_brave preparser token so filter lists can target Brave.

Brave can't be told apart from Chrome through the user agent string, so detection uses navigator.brave with navigator.userAgentData.brands as fallback. Both are synchronous, unlike navigator.brave.isBrave() — the flavor has to be settled before lists are compiled and cached. chromium stays in the soup alongside brave.

Brave still offers uBO in MV2, and a considerable number of Brave users run Brave Shields and uBO at the same time. Filters that are safe on their own can conflict when both blockers apply them, and list maintainers currently have no way to express that: uBlockOrigin/uAssets#34162 (YouTube infinite reload loop from duelling mutation observers; an exception rule scoped to Brave measured a 30% reduction in YouTube issue reports, and removing it put them back).

MV2 only. The parser change reaches uBOL via make-mv3.sh but resolves false there, since MV3 prunes at build time.

Disclosure: I work at Brave.

Brave can't be told apart from Chrome through the user agent string, so
detection uses `navigator.brave` with `navigator.userAgentData.brands`
as fallback. Both are synchronous, unlike `navigator.brave.isBrave()` --
the flavor must be settled before filter lists are compiled and cached.

Brave still offers uBO in MV2, and a considerable number of Brave users
run Brave Shields and uBO at the same time. Filters which are safe on
their own can conflict when both blockers apply them, and list
maintainers currently have no way to express that:
uBlockOrigin/uAssets#34162
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.

1 participant