Skip to content

Commit 8813c51

Browse files
committedFeb 14, 2025
Update newtabButton to newtabButtons for multiple button handling in ZenUIManager
1 parent 47824d8 commit 8813c51

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎src/browser/base/content/ZenUIManager.mjs

+8-4
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ var gZenUIManager = {
147147
this.__currentPopupTrackElement = null;
148148
},
149149

150-
get newtabButton() {
151-
return ZenWorkspaces.activeWorkspaceStrip.querySelector('#tabs-newtab-button');
150+
get newtabButtons() {
151+
return document.querySelectorAll('#tabs-newtab-button');
152152
},
153153

154154
_prevUrlbarLabel: null,
@@ -168,7 +168,9 @@ var gZenUIManager = {
168168
this._prevUrlbarLabel = gURLBar._untrimmedValue;
169169
gURLBar._zenHandleUrlbarClose = this.handleUrlbarClose.bind(this);
170170
gURLBar.setAttribute('zen-newtab', true);
171-
this.newtabButton.setAttribute('in-urlbar', true);
171+
for (const button of this.newtabButtons) {
172+
button.setAttribute('in-urlbar', true);
173+
}
172174
document.getElementById('Browser:OpenLocation').doCommand();
173175
gURLBar.search(this._lastSearch);
174176
return true;
@@ -186,7 +188,9 @@ var gZenUIManager = {
186188
gURLBar.removeAttribute('zen-newtab');
187189
this._lastTab._visuallySelected = true;
188190
this._lastTab = null;
189-
this.newtabButton.removeAttribute('in-urlbar');
191+
for (const button of this.newtabButtons) {
192+
button.removeAttribute('in-urlbar');
193+
}
190194
if (onSwitch) {
191195
this.clearUrlbarData();
192196
} else {

0 commit comments

Comments
 (0)
Failed to load comments.