Skip to content

Commit

Permalink
Update newtabButton to newtabButtons for multiple button handling in …
Browse files Browse the repository at this point in the history
…ZenUIManager
  • Loading branch information
mauro-balades committed Feb 14, 2025
1 parent 47824d8 commit 8813c51
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/browser/base/content/ZenUIManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ var gZenUIManager = {
this.__currentPopupTrackElement = null;
},

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

_prevUrlbarLabel: null,
Expand All @@ -168,7 +168,9 @@ var gZenUIManager = {
this._prevUrlbarLabel = gURLBar._untrimmedValue;
gURLBar._zenHandleUrlbarClose = this.handleUrlbarClose.bind(this);
gURLBar.setAttribute('zen-newtab', true);
this.newtabButton.setAttribute('in-urlbar', true);
for (const button of this.newtabButtons) {
button.setAttribute('in-urlbar', true);
}
document.getElementById('Browser:OpenLocation').doCommand();
gURLBar.search(this._lastSearch);
return true;
Expand All @@ -186,7 +188,9 @@ var gZenUIManager = {
gURLBar.removeAttribute('zen-newtab');
this._lastTab._visuallySelected = true;
this._lastTab = null;
this.newtabButton.removeAttribute('in-urlbar');
for (const button of this.newtabButtons) {
button.removeAttribute('in-urlbar');
}
if (onSwitch) {
this.clearUrlbarData();
} else {
Expand Down

0 comments on commit 8813c51

Please sign in to comment.