Skip to content

Conversation

@blakegearin
Copy link
Contributor

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 swich 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 = ...

align-items: center;
padding: 10px 9px;
padding-bottom: 0;
padding-bottom: 8px;
Copy link
Member

Choose a reason for hiding this comment

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

This should only be set if the preference is enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll defer to you on that.

For context, the reason I added it was for tabs like about:config where only the toolbar buttons are shown now when hide-unified-extensions-button: false

Example

image

It does make the spacing between sections a little more consistent. But I can add the gating if you'd like.

  • Before

    image
  • After

    image

#unified-extensions-button:not([showing]) {
display: none !important;
@media not -moz-pref('zen.theme.hide-unified-extensions-button') {
.zen-site-data-section:has(#unified-extensions-manage-extensions) {
Copy link
Member

Choose a reason for hiding this comment

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

Don't use :has, better set an attribute to the section that contains the addons list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 Understood

Commit: 1caf0b4

@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


case "toolbarvisibilitychange":
- this.onToolbarVisibilityChange(event.target.id, event.detail.visible);
+ this.onToolbarVisibilityChange(event.target.id, event.detail.visible, panel);
Copy link
Member

Choose a reason for hiding this comment

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

You are still passing panel as an argument though?

this.extensionsPanelView = 'original-unified-extensions-view';

if (!Services.prefs.getBoolPref('zen.theme.hide-unified-extensions-button', true)) {
this.window.gUnifiedExtensions._panel = this.extensionsPanel = this.#initExtensionsPanel();
Copy link
Member

Choose a reason for hiding this comment

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

We technically don't need to run this as the default panel for the gUnifiedExtensions is already the extensions panel

Copy link
Member

Choose a reason for hiding this comment

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

@blakegearin I wonder, if you simply return past this point, how does firefox react? Does it start using the old popup?

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

Labels

Feature 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