Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 126 additions & 32 deletions src/browser/base/content/browser-addons-js.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/browser/base/content/browser-addons.js b/browser/base/content/browser-addons.js
index fadcbfca95ee28140579430c0371baad0e2f216a..7454b801b4ad892d6ad122277eb7c7736e976f9f 100644
index fadcbfca95ee28140579430c0371baad0e2f216a..546af74c2d758699980b6234ba272a8b7da64870 100644
--- a/browser/base/content/browser-addons.js
+++ b/browser/base/content/browser-addons.js
@@ -1069,7 +1069,7 @@ var gXPInstallObserver = {
Expand All @@ -10,7 +10,7 @@ index fadcbfca95ee28140579430c0371baad0e2f216a..7454b801b4ad892d6ad122277eb7c773
+ position: gZenUIManager.panelUIPosition(),
},
};

@@ -1279,7 +1279,7 @@ var gXPInstallObserver = {
hideClose: true,
timeout: Date.now() + 30000,
Expand All @@ -19,15 +19,15 @@ index fadcbfca95ee28140579430c0371baad0e2f216a..7454b801b4ad892d6ad122277eb7c773
+ position: gZenUIManager.panelUIPosition(),
},
};

@@ -2211,7 +2211,7 @@ var gUnifiedExtensions = {
// If the new ID is not added in NOTIFICATION_IDS, consider handling the case
// in the "PopupNotificationsBeforeAnchor" handler elsewhere in this file.
getPopupAnchorID(aBrowser, aWindow) {
- const anchorID = "unified-extensions-button";
+ const anchorID = "zen-site-data-icon-button";
const attr = anchorID + "popupnotificationanchor";

if (!aBrowser[attr]) {
@@ -2222,7 +2222,7 @@ var gUnifiedExtensions = {
anchorID
Expand All @@ -36,58 +36,152 @@ index fadcbfca95ee28140579430c0371baad0e2f216a..7454b801b4ad892d6ad122277eb7c773
- ).firstElementChild;
+ );
}

return anchorID;
@@ -2657,11 +2657,7 @@ var gUnifiedExtensions = {
// Lazy load the unified-extensions-panel panel the first time we need to
// display it.
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"
@@ -2547,7 +2547,7 @@ var gUnifiedExtensions = {
requestAnimationFrame(() => this.updateAttention());
},

- onToolbarVisibilityChange(toolbarId, isVisible) {
+ onToolbarVisibilityChange(toolbarId, isVisible, panel = this.panel) {
// A list of extension widget IDs (possibly empty).
let widgetIDs;

@@ -2561,7 +2561,7 @@ var gUnifiedExtensions = {
}

// The list of overflowed extensions in the extensions panel.
- const overflowedExtensionsList = this.panel.querySelector(
+ const overflowedExtensionsList = panel.querySelector(
"#overflowed-extensions-list"
);

@@ -2662,37 +2662,41 @@ var gUnifiedExtensions = {
);
@@ -2714,6 +2710,7 @@ var gUnifiedExtensions = {
// and no alternative content is available for display in the panel.
const policies = this.getActivePolicies();
template.replaceWith(template.content);
this._panel = document.getElementById("unified-extensions-panel");
- let customizationArea = this._panel.querySelector(
- "#unified-extensions-area"
- );
- CustomizableUI.registerPanelNode(
- customizationArea,
- CustomizableUI.AREA_ADDONS
- );
- CustomizableUI.addPanelCloseListeners(this._panel);
-
- this._panel
- .querySelector("#unified-extensions-manage-extensions")
- .addEventListener("command", () => {
- BrowserAddonUI.openAddonsMgr("addons://list/extension");
- });
-
- // Lazy-load the l10n strings. Those strings are used for the CUI and
- // non-CUI extensions in the unified extensions panel.
- document
- .getElementById("unified-extensions-context-menu")
- .querySelectorAll("[data-lazy-l10n-id]")
- .forEach(el => {
- el.setAttribute("data-l10n-id", el.getAttribute("data-lazy-l10n-id"));
- el.removeAttribute("data-lazy-l10n-id");
- });
+ this.initializePanel(this._panel);
}
return this._panel;
},

+ initializePanel(panel) {
+ let customizationArea = panel.querySelector(
+ "#unified-extensions-area"
+ );
+ CustomizableUI.registerPanelNode(
+ customizationArea,
+ CustomizableUI.AREA_ADDONS
+ );
+ CustomizableUI.addPanelCloseListeners(panel);
+
+ panel
+ .querySelector("#unified-extensions-manage-extensions")
+ .addEventListener("command", () => {
+ BrowserAddonUI.openAddonsMgr("addons://list/extension");
+ });
+
+ // Lazy-load the l10n strings. Those strings are used for the CUI and
+ // non-CUI extensions in the unified extensions panel.
+ document
+ .getElementById("unified-extensions-context-menu")
+ .querySelectorAll("[data-lazy-l10n-id]")
+ .forEach(el => {
+ el.setAttribute("data-l10n-id", el.getAttribute("data-lazy-l10n-id"));
+ el.removeAttribute("data-lazy-l10n-id");
+ });
+ },
+
// `aEvent` and `reason` are optional. If `reason` is specified, it should be
// a valid argument to gUnifiedExtensions.recordButtonTelemetry().
- async togglePanel(aEvent, reason) {
+ async togglePanel(aEvent, reason, panel = this._panel, view, button) {
if (!CustomizationHandler.isCustomizing()) {
if (aEvent) {
if (
+ false &&
policies.length &&
!this.hasExtensionsInPanel(policies) &&
!this.isPrivateWindowMissingExtensionsWithoutPBMAccess() &&
@@ -2754,7 +2751,7 @@ var gUnifiedExtensions = {
@@ -2729,32 +2733,30 @@ var gUnifiedExtensions = {
this.blocklistAttentionInfo =
await AddonManager.getBlocklistAttentionInfo();

- let panel = this.panel;
-
if (!this._listView) {
this._listView = PanelMultiView.getViewNode(
document,
- "unified-extensions-view"
+ view,
);
this._listView.addEventListener("ViewShowing", this);
this._listView.addEventListener("ViewHiding", this);
}

- if (this._button.open) {
+ if (button.open) {
PanelMultiView.hidePopup(panel);
- this._button.open = false;
+ button.open = false;
} else {
// Overflow extensions placed in collapsed toolbars, if any.
for (const toolbarId of CustomizableUI.getCollapsedToolbarIds(window)) {
// We pass `false` because all these toolbars are collapsed.
- this.onToolbarVisibilityChange(toolbarId, /* isVisible */ false);
+ this.onToolbarVisibilityChange(toolbarId, /* isVisible */ false, panel);
}

panel.hidden = false;
this.recordButtonTelemetry(reason || "extensions_panel_showing");
this.ensureButtonShownBeforeAttachingPanel(panel);
PanelMultiView.openPopup(panel, this._button, {
- PanelMultiView.openPopup(panel, this._button, {
- position: "bottomright topright",
+ position: gZenUIManager.panelUIPosition(panel, this._button),
+ PanelMultiView.openPopup(panel, button, {
+ position: gZenUIManager.panelUIPosition(panel, button),
triggerEvent: aEvent,
});
}
@@ -2941,18 +2938,20 @@ var gUnifiedExtensions = {
@@ -2941,18 +2943,20 @@ var gUnifiedExtensions = {
this._maybeMoveWidgetNodeBack(widgetId);
}

- this.pinToToolbar(widgetId, shouldPinToToolbar);
+ await this.pinToToolbar(widgetId, shouldPinToToolbar);
},

- pinToToolbar(widgetId, shouldPinToToolbar) {
+ async pinToToolbar(widgetId, shouldPinToToolbar) {
let newArea = shouldPinToToolbar
? CustomizableUI.AREA_NAVBAR
: CustomizableUI.AREA_ADDONS;
let newPosition = shouldPinToToolbar ? undefined : 0;
+ await gZenVerticalTabsManager._preCustomize();

CustomizableUI.addWidgetToArea(widgetId, newArea, newPosition);
// addWidgetToArea() will trigger onWidgetAdded or onWidgetMoved as needed,
// and our handlers will call updateAttention() as needed.
+ await gZenVerticalTabsManager._postCustomize();
},

async moveWidget(menu, direction) {
43 changes: 33 additions & 10 deletions src/browser/base/content/navigator-toolbox-js.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/browser/base/content/navigator-toolbox.js b/browser/base/content/navigator-toolbox.js
index 7b776b15d52367a008ce6bf53dcfcbbe007b7453..d9a3404905b73db7c8f202ab166d5f3c625351f6 100644
index 7b776b15d52367a008ce6bf53dcfcbbe007b7453..4df8419b20b25810bea8b344af84655f16b532c8 100644
--- a/browser/base/content/navigator-toolbox.js
+++ b/browser/base/content/navigator-toolbox.js
@@ -6,7 +6,7 @@
Expand All @@ -9,25 +9,40 @@ index 7b776b15d52367a008ce6bf53dcfcbbe007b7453..d9a3404905b73db7c8f202ab166d5f3c
- const navigatorToolbox = document.getElementById("navigator-toolbox");
+ const navigatorToolbox = document.getElementById("browser");
const widgetOverflow = document.getElementById("widget-overflow");

function onPopupShowing(event) {
@@ -185,6 +185,7 @@ document.addEventListener(
@@ -137,7 +137,13 @@ document.addEventListener(
break;

case "unified-extensions-button":
- gUnifiedExtensions.togglePanel(event);
+ gUnifiedExtensions.togglePanel(
+ event,
+ null,
+ window.gZenSiteDataPanel.extensionsPanel,
+ window.gZenSiteDataPanel.extensionsPanelView,
+ window.gZenSiteDataPanel.extensionsPanelButton,
+ );
break;

case "library-button":
@@ -185,6 +191,7 @@ document.addEventListener(
#reload-button ,
#urlbar-go-button,
#reader-mode-button,
+ #zen-tabs-wrapper,
#picture-in-picture-button,
#urlbar-zoom-button,
#star-button-box,
@@ -206,6 +207,7 @@ document.addEventListener(
@@ -206,6 +213,7 @@ document.addEventListener(
case "vertical-tabs-newtab-button":
case "tabs-newtab-button":
case "new-tab-button":
+ case "zen-tabs-wrapper":
gBrowser.handleNewTabMiddleClick(element, event);
break;
@@ -315,7 +317,7 @@ document.addEventListener(

@@ -315,7 +323,7 @@ document.addEventListener(
#pageActionButton,
#downloads-button,
#fxa-toolbar-menu-button,
Expand All @@ -36,12 +51,20 @@ index 7b776b15d52367a008ce6bf53dcfcbbe007b7453..d9a3404905b73db7c8f202ab166d5f3c
#library-button
`);
if (!element) {
@@ -394,7 +396,7 @@ document.addEventListener(
@@ -394,8 +402,14 @@ document.addEventListener(
gSync.toggleAccountPanel(element, event);
break;

- case "unified-extensions-button":
- gUnifiedExtensions.togglePanel(event);
+ case "zen-site-data-icon-button":
gUnifiedExtensions.togglePanel(event);
+ gUnifiedExtensions.togglePanel(
+ event,
+ null,
+ window.gZenSiteDataPanel.unifiedPanel,
+ window.gZenSiteDataPanel.unifiedPanelView,
+ window.gZenSiteDataPanel.unifiedPanelButton,
+ );
break;


case "library-button":
6 changes: 3 additions & 3 deletions src/browser/base/content/zen-panels/site-data.inc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
command="Browser:AddBookmarkAs"
flex="1" />
</hbox>
<vbox class="zen-site-data-section">
<vbox id="zen-site-data-section-addons" class="zen-site-data-section">
<hbox class="zen-site-data-section-header">
<label data-l10n-id="unified-extensions-header-title" flex="1" />
<label data-l10n-id="zen-generic-manage" id="zen-site-data-manage-addons" />
Expand Down Expand Up @@ -72,7 +72,7 @@
# for this specific button / id
<toolbarbutton id="unified-extensions-manage-extensions"
class="subviewbutton panel-subview-footer-button unified-extensions-manage-extensions"
data-l10n-id="unified-extensions-manage-extensions"
data-l10n-id="unified-extensions-manage-extensions"
hidden="true" />
</vbox>
<vbox class="zen-site-data-section">
Expand All @@ -85,7 +85,7 @@
</vbox>
</vbox>
<hbox id="zen-site-data-footer">
<toolbarbutton id="zen-site-data-security-info"
<toolbarbutton id="zen-site-data-security-info"
class="subviewbutton zen-interactive-button" />
<toolbarbutton id="zen-site-data-actions"
class="subviewbutton zen-interactive-button"
Expand Down
14 changes: 10 additions & 4 deletions src/zen/common/styles/zen-single-components.css
Original file line number Diff line number Diff line change
Expand Up @@ -497,17 +497,23 @@ body > #confetti {
#unified-extensions-button {
display: none !important;
}

#unified-extensions-button:not([showing]) {
display: none !important;
}
}

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

#zen-site-data-header {
gap: 8px;
align-items: center;
padding: 10px 9px;
padding-bottom: 0;
padding-bottom: 8px;

:root[zen-single-toolbar='true']:not([zen-right-side='true']) & {
flex-direction: row-reverse;
Expand All @@ -519,7 +525,7 @@ body > #confetti {
-moz-context-properties: fill;
fill: currentColor;
color: light-dark(rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0.8));
max-width: 48px;
width: 48px;
height: 32px;
position: relative;

Expand Down
Loading