-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Enable original extensions panel on hide-unified-extensions-button: false #11335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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:
desktop/src/browser/base/content/browser-addons-js.patch
Lines 44 to 52 in 0899621
| 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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 Understood
Commit: 1caf0b4
Yes, that's true. Effectively that's what |
|
|
||
| case "toolbarvisibilitychange": | ||
| - this.onToolbarVisibilityChange(event.target.id, event.detail.visible); | ||
| + this.onToolbarVisibilityChange(event.target.id, event.detail.visible, panel); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?



Summary
Updated
ZenSiteDataPanel.sys.mjsto support multiple panels and pass relevant objects tobrowser-addons.jsPatched
browser-addons.jsto accept panel objectsPatched
navigator-toolbox.jsto get panel objects fromwindow.gZenSiteDataPanelUpdated
zen-single-components.cssto conditionally hide extensions on unified panelScreenshots
hide-unified-extensions-button: truehide-unified-extensions-button: falseNotes
hide-unified-extensions-buttondoes 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 appearbrowser/components/customizableui/CustomizableUI.sys.mjsis able to natively support adding and removing extensions from multiple areas