-
-
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 = ...
Yes, that's true. Effectively that's what |
| notInPanel || | ||
| document.querySelector("#unified-extensions-area > :first-child") | ||
| - ?.id === widgetId | ||
| + ?.id === widgetIdz |
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.
Where's widgetIdz defined?
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.
Whoops, just an extra character that slipped in. Good catch.
Commit: 31f4d4e
| - let template = document.getElementById( | ||
| - "unified-extensions-panel-template" | ||
| - ); | ||
| - template.replaceWith(template.content); |
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 removing, you should just see if the preference is enabled and then do what the patch is originally doing or firefox's addon functionality.
https://github.com/zen-browser/desktop/pull/11335/files#r2545668861
mr-cheffy
left a comment
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.
I'll give it a test try later today, looks good overall
| // Partial implementation of "get panel()" from engine/browser/base/content/browser-addons.js | ||
| const { BrowserAddonUI, CustomizableUI } = this.window; | ||
|
|
||
| CustomizableUI.registerPanelNode(customizationArea, CustomizableUI.AREA_ADDONS); |
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.
Not really sure about this, as doing re-implementations might be hard to sync when updating upstream. Maybe some unit tests would help this issue?
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.
Where do unit tests live? I could give it a shot
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 can give it a try here: https://github.com/zen-browser/desktop/tree/dev/src/zen/tests
Making a new directory like "control-panel" for example
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