Enhance tab label handling to support static labels and filter glance tabs during tab movement

This commit is contained in:
mr. M 2025-02-15 01:49:22 +01:00
parent 1eb04862fc
commit 25b41f8bb6
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..545a6122bc6d6ee55dab7f020cfbe1f13966d8e2 100644
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..8f2cd9ecd708e58a6b162740bb21dafeda43b085 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -406,11 +406,52 @@
@ -112,6 +112,15 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..545a6122bc6d6ee55dab7f020cfbe1f1
// If focus is on the old tab, move it to the new tab.
if (activeEl == oldTab) {
newTab.focus();
@@ -1785,7 +1835,7 @@
}
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
- if (!aLabel || aLabel.includes("about:reader?")) {
+ if (!aLabel || aLabel.includes("about:reader?") || aTab.hasAttribute("zen-has-static-label")) {
return false;
}
@@ -2387,7 +2437,7 @@
let panel = this.getPanel(browser);
@ -351,6 +360,15 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..545a6122bc6d6ee55dab7f020cfbe1f1
}
if (aTab._tPos == aIndex) {
return;
@@ -5717,7 +5825,7 @@
this._lastRelatedTabMap = new WeakMap();
this._handleTabMove(aTab, () => {
- let neighbor = this.tabs[aIndex];
+ let neighbor = this.tabs.filter(tab => !tab.hasAttribute("zen-glance-tab"))[aIndex];
if (forceStandaloneTab && neighbor.group) {
neighbor = neighbor.group;
}
@@ -5727,6 +5835,9 @@
this.tabContainer.insertBefore(aTab, neighbor);
}