Skip to content

feat: Add Arc's boosts implementation, b=no-bug, c=boosts#11071

Merged
mr-cheffy merged 136 commits intozen-browser:boostsfrom
FlorianButz:dev
Mar 2, 2026
Merged

feat: Add Arc's boosts implementation, b=no-bug, c=boosts#11071
mr-cheffy merged 136 commits intozen-browser:boostsfrom
FlorianButz:dev

Conversation

@FlorianButz
Copy link
Copy Markdown

This PR aims to implement a basic version of the Boosts feature from Arc. This currently features font customization, theme customization and smart inverting.

ScreenRecording_Boosts.mp4

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. Feature labels Oct 29, 2025
@FlorianButz FlorianButz marked this pull request as draft October 29, 2025 20:55
@12th-devs
Copy link
Copy Markdown
Contributor

I love this so much!

@mr-cheffy
Copy link
Copy Markdown
Member

I've added the boilerplate code we should use in order to change how firefox renders colors for certain shells. If you could make it in a window instead of a popup, it would be great via using Services.obs to communicate. Would also remove the need for ZenBoosts.mjs.

@mr-cheffy
Copy link
Copy Markdown
Member

Very excited for the implementation I came up with!

We edit firefox's rendering engine to "filter" the colors that where going to be displayed on the screen, unlike arc which I believe they use filters on the document. This means our solution is more efficient + more compatible with websites

Example:

image

And here's where zen's (1) vs arc's (2) implementation really differ:

zen:
image

arc:
image

mr-cheffy and others added 20 commits October 30, 2025 18:07
Remove unecessary ZenBoosts.mjs
Update ZenBoostsEditor to be a module
Add animated sparkle icon to control center if site is boosted
Fix bad management with the boost/registered css sheet maps
Remove boost-editor.inc and references
@6639835
Copy link
Copy Markdown

6639835 commented Feb 24, 2026

Nice work! We’re almost finished!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a comprehensive Boosts feature inspired by Arc browser, allowing users to customize website appearance through font changes, color themes, smart color inversion, element hiding (zapping), and custom CSS injection. The implementation spans across multiple layers including C++ backend for color manipulation, JavaScript managers and actors for coordination, and UI components for user interaction.

Changes:

  • Added backend color manipulation system with C++ patches to Firefox's rendering engine
  • Implemented boost management system with storage, style generation, and actor-based communication
  • Created UI components including boost editor window, element selector, and zap overlay with WebGL dissolve effects

Reviewed changes

Copilot reviewed 50 out of 70 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/zen/boosts/nsZenBoostsBackend.cpp/h Core C++ backend for color filtering and inversion
src/zen/boosts/ZenBoostsManager.sys.mjs Main boost management, storage, and coordination
src/zen/boosts/actors/*.sys.mjs Parent/child actor communication for content process
src/zen/boosts/ZenSelectorComponent.sys.mjs Element selection and CSS path generation
src/zen/boosts/ZenZapDissolve.sys.mjs WebGL-based dissolve animation for zapped elements
src/zen/urlbar/ZenSiteDataPanel.sys.mjs Integration with site data panel UI
src/layout/*/patches Patches to Firefox rendering engine for color manipulation
src/zen/tests/boosts/*.js Unit tests for selector component

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

void BrowsingContext::DidSet(FieldIndex<IDX_ZenBoostsData>,
ZenBoostData aOldValue) {
MOZ_ASSERT(IsTop());
if (ZenBoostsData() == aOldValue) {
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing early return if appInfo is null. If do_GetService fails and returns null, calling GetInSafeMode on a null pointer will crash. Add a check: if (!appInfo) { mEnabled = !inSafeMode && ...; return; }

Copilot uses AI. Check for mistakes.
Comment thread src/zen/boosts/nsZenBoostsBackend.cpp
Comment thread src/zen/boosts/actors/ZenBoostsChild.sys.mjs Outdated
Comment thread src/zen/boosts/ZenZapDissolve.sys.mjs
Comment on lines +308 to +309
this.getElementById("selector-element-preview-text").innerHTML =
`<b>[${selection.length}]</b> ${selectionPath.substring(0, Math.min(maxPathLength, selectionPath.length))}`;
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential XSS vulnerability: Using innerHTML without sanitization. The selectionPath variable comes from user-controlled CSS selectors and is directly inserted into the DOM. Use textContent instead of innerHTML or sanitize the input properly.

Copilot uses AI. Check for mistakes.
Comment thread src/zen/workspaces/ZenGradientGenerator.mjs
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 26, 2026
@mr-cheffy mr-cheffy changed the base branch from dev to boosts March 2, 2026 17:15
@mr-cheffy mr-cheffy merged commit d459ad9 into zen-browser:boosts Mar 2, 2026
1 check passed
@mr-cheffy
Copy link
Copy Markdown
Member

#12586

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants