Skip to content

Conversation

@blakegearin
Copy link
Contributor

@blakegearin blakegearin commented Nov 18, 2025

Summary

  • Updated ZenSiteDataPanel.sys.mjs to support multiple panels and pass relevant objects to browser-addons.js

  • Patched browser-addons.js to accept panel objects

  • Patched navigator-toolbox.js to get panel objects from window.gZenSiteDataPanel

  • Updated zen-single-components.css to conditionally hide extensions on unified panel

Screenshots

  • hide-unified-extensions-button: true

    image
  • hide-unified-extensions-button: false

    image image

Notes

  • Toggling hide-unified-extensions-button does require a browser restart to fully take effect and switch over. This is because the list of extensions are added on browser initialization. It does not appear browser/components/customizableui/CustomizableUI.sys.mjs is able to natively support adding and removing extensions from multiple areas

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Feature labels Nov 18, 2025
Copy link
Member

@mr-cheffy mr-cheffy left a comment

Choose a reason for hiding this comment

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

Instead of choosing what panel should be used every time, we could just revert these changes if the preference is off:

if (!this._panel) {
- let template = document.getElementById(
- "unified-extensions-panel-template"
- );
- template.replaceWith(template.content);
- this._panel = document.getElementById("unified-extensions-panel");
+ this._panel = document.getElementById("zen-unified-site-data-panel");
let customizationArea = this._panel.querySelector(
"#unified-extensions-area"

- const anchorID = "unified-extensions-button";

Or at least simply override it? gUnifiedExtensions._panel = ...

@blakegearin
Copy link
Contributor Author

blakegearin commented Nov 19, 2025

Instead of choosing what panel should be used every time, we could just revert these changes if the preference is off:
...
Or at least simply override it? gUnifiedExtensions._panel = ...

Yes, that's true. Effectively that's what setMainPanel was for, but that approach is cleaner. And we can safely remove the patches on get panel() which is a nice side effect

Copy link
Member

@mr-cheffy mr-cheffy left a comment

Choose a reason for hiding this comment

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

I'll give it a test try later today, looks good overall

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 26, 2025
@mr-cheffy
Copy link
Member

mr-cheffy commented Dec 1, 2025

Let me know once its finished for review @blakegearin

Please run npm run lint:fix as well and patches seems to fail importing? https://github.com/zen-browser/desktop/actions/runs/19818358014/job/56774645713?pr=11335

@blakegearin
Copy link
Contributor Author

@mr-cheffy Thanks. Should be good to go.

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.

2 participants