mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-30 16:44:37 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5efe62739 | ||
|
|
e34ed3e882 | ||
|
|
658e35ebde | ||
|
|
1176f5ac8b | ||
|
|
4de01a9bc9 |
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689b5f65e94 100644
|
index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..7f759f43a4aa1e0d96f8003a50c5df269ec4a131 100644
|
||||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
@@ -398,6 +398,7 @@
|
@@ -398,6 +398,7 @@
|
||||||
@@ -119,7 +119,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
|
|
||||||
aTab.setAttribute("pinned", "true");
|
aTab.setAttribute("pinned", "true");
|
||||||
this._updateTabBarForPinnedTabs();
|
this._updateTabBarForPinnedTabs();
|
||||||
@@ -931,11 +994,18 @@
|
@@ -931,11 +994,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#handleTabMove(aTab, () => {
|
this.#handleTabMove(aTab, () => {
|
||||||
@@ -133,13 +133,14 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
// and back into arrowscrollbox.
|
// and back into arrowscrollbox.
|
||||||
aTab.removeAttribute("pinned");
|
aTab.removeAttribute("pinned");
|
||||||
- this.tabContainer.arrowScrollbox.prepend(aTab);
|
- this.tabContainer.arrowScrollbox.prepend(aTab);
|
||||||
|
+ aTab.removeAttribute("zen-essential");
|
||||||
+ if (!handled) {
|
+ if (!handled) {
|
||||||
+ gZenWorkspaces.activeWorkspaceStrip.prepend(aTab);
|
+ gZenWorkspaces.activeWorkspaceStrip.prepend(aTab);
|
||||||
+ }
|
+ }
|
||||||
});
|
});
|
||||||
|
|
||||||
aTab.style.marginInlineStart = "";
|
aTab.style.marginInlineStart = "";
|
||||||
@@ -1112,6 +1182,9 @@
|
@@ -1112,6 +1183,9 @@
|
||||||
|
|
||||||
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
|
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
|
||||||
|
|
||||||
@@ -149,7 +150,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (
|
if (
|
||||||
aIconURL &&
|
aIconURL &&
|
||||||
!LOCAL_PROTOCOLS.some(protocol => aIconURL.startsWith(protocol))
|
!LOCAL_PROTOCOLS.some(protocol => aIconURL.startsWith(protocol))
|
||||||
@@ -1121,6 +1194,9 @@
|
@@ -1121,6 +1195,9 @@
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -159,7 +160,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
|
|
||||||
let browser = this.getBrowserForTab(aTab);
|
let browser = this.getBrowserForTab(aTab);
|
||||||
browser.mIconURL = aIconURL;
|
browser.mIconURL = aIconURL;
|
||||||
@@ -1393,7 +1469,6 @@
|
@@ -1393,7 +1470,6 @@
|
||||||
|
|
||||||
// Preview mode should not reset the owner
|
// Preview mode should not reset the owner
|
||||||
if (!this._previewMode && !oldTab.selected) {
|
if (!this._previewMode && !oldTab.selected) {
|
||||||
@@ -167,7 +168,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
}
|
}
|
||||||
|
|
||||||
let lastRelatedTab = this._lastRelatedTabMap.get(oldTab);
|
let lastRelatedTab = this._lastRelatedTabMap.get(oldTab);
|
||||||
@@ -1484,6 +1559,7 @@
|
@@ -1484,6 +1560,7 @@
|
||||||
if (!this._previewMode) {
|
if (!this._previewMode) {
|
||||||
newTab.recordTimeFromUnloadToReload();
|
newTab.recordTimeFromUnloadToReload();
|
||||||
newTab.updateLastAccessed();
|
newTab.updateLastAccessed();
|
||||||
@@ -175,7 +176,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
oldTab.updateLastAccessed();
|
oldTab.updateLastAccessed();
|
||||||
// if this is the foreground window, update the last-seen timestamps.
|
// if this is the foreground window, update the last-seen timestamps.
|
||||||
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
|
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
|
||||||
@@ -1636,6 +1712,9 @@
|
@@ -1636,6 +1713,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
let activeEl = document.activeElement;
|
let activeEl = document.activeElement;
|
||||||
@@ -185,7 +186,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
// If focus is on the old tab, move it to the new tab.
|
// If focus is on the old tab, move it to the new tab.
|
||||||
if (activeEl == oldTab) {
|
if (activeEl == oldTab) {
|
||||||
newTab.focus();
|
newTab.focus();
|
||||||
@@ -1959,6 +2038,11 @@
|
@@ -1959,6 +2039,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
|
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
|
||||||
@@ -197,7 +198,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (!aLabel || aLabel.includes("about:reader?")) {
|
if (!aLabel || aLabel.includes("about:reader?")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2067,7 +2151,7 @@
|
@@ -2067,7 +2152,7 @@
|
||||||
newIndex = this.selectedTab._tPos + 1;
|
newIndex = this.selectedTab._tPos + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +207,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (this.isTabGroupLabel(targetTab)) {
|
if (this.isTabGroupLabel(targetTab)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Replacing a tab group label with a tab is not supported"
|
"Replacing a tab group label with a tab is not supported"
|
||||||
@@ -2342,6 +2426,7 @@
|
@@ -2342,6 +2427,7 @@
|
||||||
uriIsAboutBlank,
|
uriIsAboutBlank,
|
||||||
userContextId,
|
userContextId,
|
||||||
skipLoad,
|
skipLoad,
|
||||||
@@ -214,7 +215,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
} = {}) {
|
} = {}) {
|
||||||
let b = document.createXULElement("browser");
|
let b = document.createXULElement("browser");
|
||||||
// Use the JSM global to create the permanentKey, so that if the
|
// Use the JSM global to create the permanentKey, so that if the
|
||||||
@@ -2415,8 +2500,7 @@
|
@@ -2415,8 +2501,7 @@
|
||||||
// we use a different attribute name for this?
|
// we use a different attribute name for this?
|
||||||
b.setAttribute("name", name);
|
b.setAttribute("name", name);
|
||||||
}
|
}
|
||||||
@@ -224,7 +225,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
b.setAttribute("transparent", "true");
|
b.setAttribute("transparent", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2581,7 +2665,7 @@
|
@@ -2581,7 +2666,7 @@
|
||||||
|
|
||||||
let panel = this.getPanel(browser);
|
let panel = this.getPanel(browser);
|
||||||
let uniqueId = this._generateUniquePanelID();
|
let uniqueId = this._generateUniquePanelID();
|
||||||
@@ -233,7 +234,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
aTab.linkedPanel = uniqueId;
|
aTab.linkedPanel = uniqueId;
|
||||||
|
|
||||||
// Inject the <browser> into the DOM if necessary.
|
// Inject the <browser> into the DOM if necessary.
|
||||||
@@ -2640,8 +2724,8 @@
|
@@ -2640,8 +2725,8 @@
|
||||||
// If we transitioned from one browser to two browsers, we need to set
|
// If we transitioned from one browser to two browsers, we need to set
|
||||||
// hasSiblings=false on both the existing browser and the new browser.
|
// hasSiblings=false on both the existing browser and the new browser.
|
||||||
if (this.tabs.length == 2) {
|
if (this.tabs.length == 2) {
|
||||||
@@ -244,7 +245,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
} else {
|
} else {
|
||||||
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
|
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
|
||||||
}
|
}
|
||||||
@@ -2828,7 +2912,6 @@
|
@@ -2828,7 +2913,6 @@
|
||||||
this.selectedTab = this.addTrustedTab(BROWSER_NEW_TAB_URL, {
|
this.selectedTab = this.addTrustedTab(BROWSER_NEW_TAB_URL, {
|
||||||
tabIndex: tab._tPos + 1,
|
tabIndex: tab._tPos + 1,
|
||||||
userContextId: tab.userContextId,
|
userContextId: tab.userContextId,
|
||||||
@@ -252,7 +253,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
focusUrlBar: true,
|
focusUrlBar: true,
|
||||||
});
|
});
|
||||||
resolve(this.selectedBrowser);
|
resolve(this.selectedBrowser);
|
||||||
@@ -2938,6 +3021,9 @@
|
@@ -2938,6 +3022,9 @@
|
||||||
schemelessInput,
|
schemelessInput,
|
||||||
hasValidUserGestureActivation = false,
|
hasValidUserGestureActivation = false,
|
||||||
textDirectiveUserActivation = false,
|
textDirectiveUserActivation = false,
|
||||||
@@ -262,7 +263,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
} = {}
|
} = {}
|
||||||
) {
|
) {
|
||||||
// all callers of addTab that pass a params object need to pass
|
// all callers of addTab that pass a params object need to pass
|
||||||
@@ -2948,10 +3034,17 @@
|
@@ -2948,10 +3035,17 @@
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +281,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
// If we're opening a foreground tab, set the owner by default.
|
// If we're opening a foreground tab, set the owner by default.
|
||||||
ownerTab ??= inBackground ? null : this.selectedTab;
|
ownerTab ??= inBackground ? null : this.selectedTab;
|
||||||
|
|
||||||
@@ -2959,6 +3052,7 @@
|
@@ -2959,6 +3053,7 @@
|
||||||
if (this.selectedTab.owner) {
|
if (this.selectedTab.owner) {
|
||||||
this.selectedTab.owner = null;
|
this.selectedTab.owner = null;
|
||||||
}
|
}
|
||||||
@@ -288,7 +289,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
|
|
||||||
// Find the tab that opened this one, if any. This is used for
|
// Find the tab that opened this one, if any. This is used for
|
||||||
// determining positioning, and inherited attributes such as the
|
// determining positioning, and inherited attributes such as the
|
||||||
@@ -3011,6 +3105,22 @@
|
@@ -3011,6 +3106,22 @@
|
||||||
noInitialLabel,
|
noInitialLabel,
|
||||||
skipBackgroundNotify,
|
skipBackgroundNotify,
|
||||||
});
|
});
|
||||||
@@ -311,7 +312,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (insertTab) {
|
if (insertTab) {
|
||||||
// Insert the tab into the tab container in the correct position.
|
// Insert the tab into the tab container in the correct position.
|
||||||
this.#insertTabAtIndex(t, {
|
this.#insertTabAtIndex(t, {
|
||||||
@@ -3019,6 +3129,7 @@
|
@@ -3019,6 +3130,7 @@
|
||||||
ownerTab,
|
ownerTab,
|
||||||
openerTab,
|
openerTab,
|
||||||
pinned,
|
pinned,
|
||||||
@@ -319,7 +320,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
bulkOrderedOpen,
|
bulkOrderedOpen,
|
||||||
tabGroup: tabGroup ?? openerTab?.group,
|
tabGroup: tabGroup ?? openerTab?.group,
|
||||||
});
|
});
|
||||||
@@ -3037,6 +3148,7 @@
|
@@ -3037,6 +3149,7 @@
|
||||||
openWindowInfo,
|
openWindowInfo,
|
||||||
skipLoad,
|
skipLoad,
|
||||||
triggeringRemoteType,
|
triggeringRemoteType,
|
||||||
@@ -327,7 +328,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
if (focusUrlBar) {
|
if (focusUrlBar) {
|
||||||
@@ -3161,6 +3273,12 @@
|
@@ -3161,6 +3274,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,7 +341,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
// Additionally send pinned tab events
|
// Additionally send pinned tab events
|
||||||
if (pinned) {
|
if (pinned) {
|
||||||
this.#notifyPinnedStatus(t);
|
this.#notifyPinnedStatus(t);
|
||||||
@@ -3375,6 +3493,7 @@
|
@@ -3375,6 +3494,7 @@
|
||||||
isAdoptingGroup = false,
|
isAdoptingGroup = false,
|
||||||
isUserTriggered = false,
|
isUserTriggered = false,
|
||||||
telemetryUserCreateSource = "unknown",
|
telemetryUserCreateSource = "unknown",
|
||||||
@@ -348,7 +349,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
} = {}
|
} = {}
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
@@ -3385,9 +3504,6 @@
|
@@ -3385,9 +3505,6 @@
|
||||||
!this.isSplitViewWrapper(tabOrSplitView)
|
!this.isSplitViewWrapper(tabOrSplitView)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@@ -358,7 +359,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!color) {
|
if (!color) {
|
||||||
@@ -3408,9 +3524,14 @@
|
@@ -3408,9 +3525,14 @@
|
||||||
label,
|
label,
|
||||||
isAdoptingGroup
|
isAdoptingGroup
|
||||||
);
|
);
|
||||||
@@ -375,7 +376,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
);
|
);
|
||||||
group.addTabs(tabsAndSplitViews);
|
group.addTabs(tabsAndSplitViews);
|
||||||
|
|
||||||
@@ -3531,7 +3652,7 @@
|
@@ -3531,7 +3653,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#handleTabMove(tab, () =>
|
this.#handleTabMove(tab, () =>
|
||||||
@@ -384,7 +385,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3599,6 +3720,7 @@
|
@@ -3599,6 +3721,7 @@
|
||||||
color: group.color,
|
color: group.color,
|
||||||
insertBefore: newTabs[0],
|
insertBefore: newTabs[0],
|
||||||
isAdoptingGroup: true,
|
isAdoptingGroup: true,
|
||||||
@@ -392,7 +393,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3746,6 +3868,7 @@
|
@@ -3746,6 +3869,7 @@
|
||||||
openWindowInfo,
|
openWindowInfo,
|
||||||
skipLoad,
|
skipLoad,
|
||||||
triggeringRemoteType,
|
triggeringRemoteType,
|
||||||
@@ -400,7 +401,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
// If we don't have a preferred remote type (or it is `NOT_REMOTE`), and
|
// If we don't have a preferred remote type (or it is `NOT_REMOTE`), and
|
||||||
@@ -3815,6 +3938,7 @@
|
@@ -3815,6 +3939,7 @@
|
||||||
openWindowInfo,
|
openWindowInfo,
|
||||||
name,
|
name,
|
||||||
skipLoad,
|
skipLoad,
|
||||||
@@ -408,7 +409,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4003,7 +4127,7 @@
|
@@ -4003,7 +4128,7 @@
|
||||||
// Add a new tab if needed.
|
// Add a new tab if needed.
|
||||||
if (!tab) {
|
if (!tab) {
|
||||||
let createLazyBrowser =
|
let createLazyBrowser =
|
||||||
@@ -417,7 +418,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
|
|
||||||
let url = "about:blank";
|
let url = "about:blank";
|
||||||
if (tabData.entries?.length) {
|
if (tabData.entries?.length) {
|
||||||
@@ -4040,8 +4164,10 @@
|
@@ -4040,8 +4165,10 @@
|
||||||
insertTab: false,
|
insertTab: false,
|
||||||
skipLoad: true,
|
skipLoad: true,
|
||||||
preferredRemoteType,
|
preferredRemoteType,
|
||||||
@@ -429,7 +430,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (select) {
|
if (select) {
|
||||||
tabToSelect = tab;
|
tabToSelect = tab;
|
||||||
}
|
}
|
||||||
@@ -4053,7 +4179,8 @@
|
@@ -4053,7 +4180,8 @@
|
||||||
this.pinTab(tab);
|
this.pinTab(tab);
|
||||||
// Then ensure all the tab open/pinning information is sent.
|
// Then ensure all the tab open/pinning information is sent.
|
||||||
this._fireTabOpen(tab, {});
|
this._fireTabOpen(tab, {});
|
||||||
@@ -439,7 +440,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
let { groupId } = tabData;
|
let { groupId } = tabData;
|
||||||
const tabGroup = tabGroupWorkingData.get(groupId);
|
const tabGroup = tabGroupWorkingData.get(groupId);
|
||||||
// if a tab refers to a tab group we don't know, skip any group
|
// if a tab refers to a tab group we don't know, skip any group
|
||||||
@@ -4067,7 +4194,10 @@
|
@@ -4067,7 +4195,10 @@
|
||||||
tabGroup.stateData.id,
|
tabGroup.stateData.id,
|
||||||
tabGroup.stateData.color,
|
tabGroup.stateData.color,
|
||||||
tabGroup.stateData.collapsed,
|
tabGroup.stateData.collapsed,
|
||||||
@@ -451,7 +452,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
);
|
);
|
||||||
tabsFragment.appendChild(tabGroup.node);
|
tabsFragment.appendChild(tabGroup.node);
|
||||||
}
|
}
|
||||||
@@ -4112,9 +4242,23 @@
|
@@ -4112,9 +4243,23 @@
|
||||||
// to remove the old selected tab.
|
// to remove the old selected tab.
|
||||||
if (tabToSelect) {
|
if (tabToSelect) {
|
||||||
let leftoverTab = this.selectedTab;
|
let leftoverTab = this.selectedTab;
|
||||||
@@ -467,15 +468,15 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
+ gZenWorkspaces._initialTab._shouldRemove = true;
|
+ gZenWorkspaces._initialTab._shouldRemove = true;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
}
|
+ }
|
||||||
+ else {
|
+ else {
|
||||||
+ gZenWorkspaces._tabToRemoveForEmpty = this.selectedTab;
|
+ gZenWorkspaces._tabToRemoveForEmpty = this.selectedTab;
|
||||||
+ }
|
}
|
||||||
+ this._hasAlreadyInitializedZenSessionStore = true;
|
+ this._hasAlreadyInitializedZenSessionStore = true;
|
||||||
|
|
||||||
if (tabs.length > 1 || !tabs[0].selected) {
|
if (tabs.length > 1 || !tabs[0].selected) {
|
||||||
this._updateTabsAfterInsert();
|
this._updateTabsAfterInsert();
|
||||||
@@ -4305,11 +4449,14 @@
|
@@ -4305,11 +4450,14 @@
|
||||||
if (ownerTab) {
|
if (ownerTab) {
|
||||||
tab.owner = ownerTab;
|
tab.owner = ownerTab;
|
||||||
}
|
}
|
||||||
@@ -491,7 +492,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (
|
if (
|
||||||
!bulkOrderedOpen &&
|
!bulkOrderedOpen &&
|
||||||
((openerTab &&
|
((openerTab &&
|
||||||
@@ -4321,7 +4468,7 @@
|
@@ -4321,7 +4469,7 @@
|
||||||
let lastRelatedTab =
|
let lastRelatedTab =
|
||||||
openerTab && this._lastRelatedTabMap.get(openerTab);
|
openerTab && this._lastRelatedTabMap.get(openerTab);
|
||||||
let previousTab = lastRelatedTab || openerTab || this.selectedTab;
|
let previousTab = lastRelatedTab || openerTab || this.selectedTab;
|
||||||
@@ -500,7 +501,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
tabGroup = previousTab.group;
|
tabGroup = previousTab.group;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
@@ -4337,7 +4484,7 @@
|
@@ -4337,7 +4485,7 @@
|
||||||
previousTab.splitview
|
previousTab.splitview
|
||||||
) + 1;
|
) + 1;
|
||||||
} else if (previousTab.visible) {
|
} else if (previousTab.visible) {
|
||||||
@@ -509,7 +510,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
} else if (previousTab == FirefoxViewHandler.tab) {
|
} else if (previousTab == FirefoxViewHandler.tab) {
|
||||||
elementIndex = 0;
|
elementIndex = 0;
|
||||||
}
|
}
|
||||||
@@ -4365,14 +4512,14 @@
|
@@ -4365,14 +4513,14 @@
|
||||||
}
|
}
|
||||||
// Ensure index is within bounds.
|
// Ensure index is within bounds.
|
||||||
if (tab.pinned) {
|
if (tab.pinned) {
|
||||||
@@ -528,7 +529,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
|
|
||||||
if (pinned && !itemAfter?.pinned) {
|
if (pinned && !itemAfter?.pinned) {
|
||||||
itemAfter = null;
|
itemAfter = null;
|
||||||
@@ -4385,7 +4532,7 @@
|
@@ -4385,7 +4533,7 @@
|
||||||
|
|
||||||
this.tabContainer._invalidateCachedTabs();
|
this.tabContainer._invalidateCachedTabs();
|
||||||
|
|
||||||
@@ -537,7 +538,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (
|
if (
|
||||||
(this.isTab(itemAfter) && itemAfter.group == tabGroup) ||
|
(this.isTab(itemAfter) && itemAfter.group == tabGroup) ||
|
||||||
this.isSplitViewWrapper(itemAfter)
|
this.isSplitViewWrapper(itemAfter)
|
||||||
@@ -4416,7 +4563,11 @@
|
@@ -4416,7 +4564,11 @@
|
||||||
const tabContainer = pinned
|
const tabContainer = pinned
|
||||||
? this.tabContainer.pinnedTabsContainer
|
? this.tabContainer.pinnedTabsContainer
|
||||||
: this.tabContainer;
|
: this.tabContainer;
|
||||||
@@ -549,7 +550,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tab.group?.collapsed) {
|
if (tab.group?.collapsed) {
|
||||||
@@ -4431,6 +4582,7 @@
|
@@ -4431,6 +4583,7 @@
|
||||||
if (pinned) {
|
if (pinned) {
|
||||||
this._updateTabBarForPinnedTabs();
|
this._updateTabBarForPinnedTabs();
|
||||||
}
|
}
|
||||||
@@ -557,7 +558,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
|
|
||||||
TabBarVisibility.update();
|
TabBarVisibility.update();
|
||||||
}
|
}
|
||||||
@@ -4983,6 +5135,7 @@
|
@@ -4983,6 +5136,7 @@
|
||||||
telemetrySource,
|
telemetrySource,
|
||||||
} = {}
|
} = {}
|
||||||
) {
|
) {
|
||||||
@@ -565,7 +566,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
|
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
|
||||||
// can be considered equivalent to closing the window.
|
// can be considered equivalent to closing the window.
|
||||||
if (
|
if (
|
||||||
@@ -5072,6 +5225,7 @@
|
@@ -5072,6 +5226,7 @@
|
||||||
if (lastToClose) {
|
if (lastToClose) {
|
||||||
this.removeTab(lastToClose, aParams);
|
this.removeTab(lastToClose, aParams);
|
||||||
}
|
}
|
||||||
@@ -573,7 +574,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
@@ -5110,6 +5264,12 @@
|
@@ -5110,6 +5265,12 @@
|
||||||
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
|
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,7 +587,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
// Handle requests for synchronously removing an already
|
// Handle requests for synchronously removing an already
|
||||||
// asynchronously closing tab.
|
// asynchronously closing tab.
|
||||||
if (!animate && aTab.closing) {
|
if (!animate && aTab.closing) {
|
||||||
@@ -5124,6 +5284,9 @@
|
@@ -5124,6 +5285,9 @@
|
||||||
// state).
|
// state).
|
||||||
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
|
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
|
||||||
let isLastTab = this.#isLastTabInWindow(aTab);
|
let isLastTab = this.#isLastTabInWindow(aTab);
|
||||||
@@ -596,7 +597,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (
|
if (
|
||||||
!this._beginRemoveTab(aTab, {
|
!this._beginRemoveTab(aTab, {
|
||||||
closeWindowFastpath: true,
|
closeWindowFastpath: true,
|
||||||
@@ -5172,7 +5335,13 @@
|
@@ -5172,7 +5336,13 @@
|
||||||
// We're not animating, so we can cancel the animation stopwatch.
|
// We're not animating, so we can cancel the animation stopwatch.
|
||||||
Glean.browserTabclose.timeAnim.cancel(aTab._closeTimeAnimTimerId);
|
Glean.browserTabclose.timeAnim.cancel(aTab._closeTimeAnimTimerId);
|
||||||
aTab._closeTimeAnimTimerId = null;
|
aTab._closeTimeAnimTimerId = null;
|
||||||
@@ -611,7 +612,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5306,7 +5475,7 @@
|
@@ -5306,7 +5476,7 @@
|
||||||
closeWindowWithLastTab != null
|
closeWindowWithLastTab != null
|
||||||
? closeWindowWithLastTab
|
? closeWindowWithLastTab
|
||||||
: !window.toolbar.visible ||
|
: !window.toolbar.visible ||
|
||||||
@@ -620,7 +621,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
|
|
||||||
if (closeWindow) {
|
if (closeWindow) {
|
||||||
// We've already called beforeunload on all the relevant tabs if we get here,
|
// We've already called beforeunload on all the relevant tabs if we get here,
|
||||||
@@ -5330,6 +5499,7 @@
|
@@ -5330,6 +5500,7 @@
|
||||||
|
|
||||||
newTab = true;
|
newTab = true;
|
||||||
}
|
}
|
||||||
@@ -628,7 +629,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
aTab._endRemoveArgs = [closeWindow, newTab];
|
aTab._endRemoveArgs = [closeWindow, newTab];
|
||||||
|
|
||||||
// swapBrowsersAndCloseOther will take care of closing the window without animation.
|
// swapBrowsersAndCloseOther will take care of closing the window without animation.
|
||||||
@@ -5370,13 +5540,7 @@
|
@@ -5370,13 +5541,7 @@
|
||||||
aTab._mouseleave();
|
aTab._mouseleave();
|
||||||
|
|
||||||
if (newTab) {
|
if (newTab) {
|
||||||
@@ -643,7 +644,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
} else {
|
} else {
|
||||||
TabBarVisibility.update();
|
TabBarVisibility.update();
|
||||||
}
|
}
|
||||||
@@ -5509,6 +5673,7 @@
|
@@ -5509,6 +5674,7 @@
|
||||||
this.tabs[i]._tPos = i;
|
this.tabs[i]._tPos = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -651,7 +652,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (!this._windowIsClosing) {
|
if (!this._windowIsClosing) {
|
||||||
// update tab close buttons state
|
// update tab close buttons state
|
||||||
this.tabContainer._updateCloseButtons();
|
this.tabContainer._updateCloseButtons();
|
||||||
@@ -5732,6 +5897,7 @@
|
@@ -5732,6 +5898,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
let excludeTabs = new Set(aExcludeTabs);
|
let excludeTabs = new Set(aExcludeTabs);
|
||||||
@@ -659,7 +660,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
|
|
||||||
// If this tab has a successor, it should be selectable, since
|
// If this tab has a successor, it should be selectable, since
|
||||||
// hiding or closing a tab removes that tab as a successor.
|
// hiding or closing a tab removes that tab as a successor.
|
||||||
@@ -5744,15 +5910,22 @@
|
@@ -5744,15 +5911,22 @@
|
||||||
!excludeTabs.has(aTab.owner) &&
|
!excludeTabs.has(aTab.owner) &&
|
||||||
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
|
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
|
||||||
) {
|
) {
|
||||||
@@ -684,7 +685,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
let tab = this.tabContainer.findNextTab(aTab, {
|
let tab = this.tabContainer.findNextTab(aTab, {
|
||||||
direction: 1,
|
direction: 1,
|
||||||
filter: _tab => remainingTabs.includes(_tab),
|
filter: _tab => remainingTabs.includes(_tab),
|
||||||
@@ -5766,7 +5939,7 @@
|
@@ -5766,7 +5940,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tab) {
|
if (tab) {
|
||||||
@@ -693,7 +694,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If no qualifying visible tab was found, see if there is a tab in
|
// If no qualifying visible tab was found, see if there is a tab in
|
||||||
@@ -5787,7 +5960,7 @@
|
@@ -5787,7 +5961,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -702,7 +703,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
}
|
}
|
||||||
|
|
||||||
_blurTab(aTab) {
|
_blurTab(aTab) {
|
||||||
@@ -5798,7 +5971,7 @@
|
@@ -5798,7 +5972,7 @@
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
* False if swapping isn't permitted, true otherwise.
|
* False if swapping isn't permitted, true otherwise.
|
||||||
*/
|
*/
|
||||||
@@ -711,7 +712,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
// Do not allow transfering a private tab to a non-private window
|
// Do not allow transfering a private tab to a non-private window
|
||||||
// and vice versa.
|
// and vice versa.
|
||||||
if (
|
if (
|
||||||
@@ -5852,6 +6025,7 @@
|
@@ -5852,6 +6026,7 @@
|
||||||
// fire the beforeunload event in the process. Close the other
|
// fire the beforeunload event in the process. Close the other
|
||||||
// window if this was its last tab.
|
// window if this was its last tab.
|
||||||
if (
|
if (
|
||||||
@@ -719,7 +720,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
!remoteBrowser._beginRemoveTab(aOtherTab, {
|
!remoteBrowser._beginRemoveTab(aOtherTab, {
|
||||||
adoptedByTab: aOurTab,
|
adoptedByTab: aOurTab,
|
||||||
closeWindowWithLastTab: true,
|
closeWindowWithLastTab: true,
|
||||||
@@ -5863,7 +6037,7 @@
|
@@ -5863,7 +6038,7 @@
|
||||||
// If this is the last tab of the window, hide the window
|
// If this is the last tab of the window, hide the window
|
||||||
// immediately without animation before the docshell swap, to avoid
|
// immediately without animation before the docshell swap, to avoid
|
||||||
// about:blank being painted.
|
// about:blank being painted.
|
||||||
@@ -728,7 +729,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (closeWindow) {
|
if (closeWindow) {
|
||||||
let win = aOtherTab.ownerGlobal;
|
let win = aOtherTab.ownerGlobal;
|
||||||
win.windowUtils.suppressAnimation(true);
|
win.windowUtils.suppressAnimation(true);
|
||||||
@@ -5987,11 +6161,13 @@
|
@@ -5987,11 +6162,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finish tearing down the tab that's going away.
|
// Finish tearing down the tab that's going away.
|
||||||
@@ -742,7 +743,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
|
|
||||||
this.setTabTitle(aOurTab);
|
this.setTabTitle(aOurTab);
|
||||||
|
|
||||||
@@ -6193,10 +6369,10 @@
|
@@ -6193,10 +6370,10 @@
|
||||||
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
|
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -755,7 +756,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
aTab.selected ||
|
aTab.selected ||
|
||||||
aTab.closing ||
|
aTab.closing ||
|
||||||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
||||||
@@ -6254,7 +6430,8 @@
|
@@ -6254,7 +6431,8 @@
|
||||||
*
|
*
|
||||||
* @param {MozTabbrowserTab|MozTabbrowserTabGroup|MozTabbrowserTabGroup.labelElement} aTab
|
* @param {MozTabbrowserTab|MozTabbrowserTabGroup|MozTabbrowserTabGroup.labelElement} aTab
|
||||||
*/
|
*/
|
||||||
@@ -765,7 +766,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (this.tabs.length == 1) {
|
if (this.tabs.length == 1) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -6278,12 +6455,14 @@
|
@@ -6278,12 +6456,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// tell a new window to take the "dropped" tab
|
// tell a new window to take the "dropped" tab
|
||||||
@@ -781,7 +782,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6388,7 +6567,7 @@
|
@@ -6388,7 +6568,7 @@
|
||||||
* `true` if element is a `<tab-group>`
|
* `true` if element is a `<tab-group>`
|
||||||
*/
|
*/
|
||||||
isTabGroup(element) {
|
isTabGroup(element) {
|
||||||
@@ -790,7 +791,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6473,8 +6652,8 @@
|
@@ -6473,8 +6653,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't allow mixing pinned and unpinned tabs.
|
// Don't allow mixing pinned and unpinned tabs.
|
||||||
@@ -801,7 +802,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
} else {
|
} else {
|
||||||
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
|
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
|
||||||
}
|
}
|
||||||
@@ -6500,10 +6679,16 @@
|
@@ -6500,10 +6680,16 @@
|
||||||
this.#handleTabMove(
|
this.#handleTabMove(
|
||||||
element,
|
element,
|
||||||
() => {
|
() => {
|
||||||
@@ -820,7 +821,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
|
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
|
||||||
neighbor.after(element);
|
neighbor.after(element);
|
||||||
} else {
|
} else {
|
||||||
@@ -6561,23 +6746,31 @@
|
@@ -6561,23 +6747,31 @@
|
||||||
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
|
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
|
||||||
if (this.isTabGroupLabel(targetElement)) {
|
if (this.isTabGroupLabel(targetElement)) {
|
||||||
targetElement = targetElement.group;
|
targetElement = targetElement.group;
|
||||||
@@ -858,7 +859,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
} else if (!element.pinned && targetElement && targetElement.pinned) {
|
} else if (!element.pinned && targetElement && targetElement.pinned) {
|
||||||
// If the caller asks to move an unpinned element next to a pinned
|
// If the caller asks to move an unpinned element next to a pinned
|
||||||
// tab, move the unpinned element to be the first unpinned element
|
// tab, move the unpinned element to be the first unpinned element
|
||||||
@@ -6590,14 +6783,34 @@
|
@@ -6590,14 +6784,34 @@
|
||||||
// move the tab group right before the first unpinned tab.
|
// move the tab group right before the first unpinned tab.
|
||||||
// 4. Moving a tab group and the first unpinned tab is grouped:
|
// 4. Moving a tab group and the first unpinned tab is grouped:
|
||||||
// move the tab group right before the first unpinned tab's tab group.
|
// move the tab group right before the first unpinned tab's tab group.
|
||||||
@@ -894,7 +895,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
element.pinned
|
element.pinned
|
||||||
? this.tabContainer.pinnedTabsContainer
|
? this.tabContainer.pinnedTabsContainer
|
||||||
: this.tabContainer;
|
: this.tabContainer;
|
||||||
@@ -6606,7 +6819,7 @@
|
@@ -6606,7 +6820,7 @@
|
||||||
element,
|
element,
|
||||||
() => {
|
() => {
|
||||||
if (moveBefore) {
|
if (moveBefore) {
|
||||||
@@ -903,7 +904,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
} else if (targetElement) {
|
} else if (targetElement) {
|
||||||
targetElement.after(element);
|
targetElement.after(element);
|
||||||
} else {
|
} else {
|
||||||
@@ -6676,10 +6889,10 @@
|
@@ -6676,10 +6890,10 @@
|
||||||
* @param {TabMetricsContext} [metricsContext]
|
* @param {TabMetricsContext} [metricsContext]
|
||||||
*/
|
*/
|
||||||
moveTabToExistingGroup(aTab, aGroup, metricsContext) {
|
moveTabToExistingGroup(aTab, aGroup, metricsContext) {
|
||||||
@@ -916,7 +917,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (aTab.group && aTab.group.id === aGroup.id) {
|
if (aTab.group && aTab.group.id === aGroup.id) {
|
||||||
@@ -6751,6 +6964,7 @@
|
@@ -6751,6 +6965,7 @@
|
||||||
|
|
||||||
let state = {
|
let state = {
|
||||||
tabIndex: tab._tPos,
|
tabIndex: tab._tPos,
|
||||||
@@ -924,7 +925,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
};
|
};
|
||||||
if (tab.visible) {
|
if (tab.visible) {
|
||||||
state.elementIndex = tab.elementIndex;
|
state.elementIndex = tab.elementIndex;
|
||||||
@@ -6777,7 +6991,7 @@
|
@@ -6777,7 +6992,7 @@
|
||||||
let changedTabGroup =
|
let changedTabGroup =
|
||||||
previousTabState.tabGroupId != currentTabState.tabGroupId;
|
previousTabState.tabGroupId != currentTabState.tabGroupId;
|
||||||
|
|
||||||
@@ -933,7 +934,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
tab.dispatchEvent(
|
tab.dispatchEvent(
|
||||||
new CustomEvent("TabMove", {
|
new CustomEvent("TabMove", {
|
||||||
bubbles: true,
|
bubbles: true,
|
||||||
@@ -6818,6 +7032,10 @@
|
@@ -6818,6 +7033,10 @@
|
||||||
|
|
||||||
moveActionCallback();
|
moveActionCallback();
|
||||||
|
|
||||||
@@ -944,7 +945,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
// Clear tabs cache after moving nodes because the order of tabs may have
|
// Clear tabs cache after moving nodes because the order of tabs may have
|
||||||
// changed.
|
// changed.
|
||||||
this.tabContainer._invalidateCachedTabs();
|
this.tabContainer._invalidateCachedTabs();
|
||||||
@@ -6869,6 +7087,19 @@
|
@@ -6869,6 +7088,18 @@
|
||||||
* The new tab in the current window, null if the tab couldn't be adopted.
|
* The new tab in the current window, null if the tab couldn't be adopted.
|
||||||
*/
|
*/
|
||||||
adoptTab(aTab, { elementIndex, tabIndex, selectTab = false } = {}) {
|
adoptTab(aTab, { elementIndex, tabIndex, selectTab = false } = {}) {
|
||||||
@@ -959,7 +960,6 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
|
|||||||
+ }
|
+ }
|
||||||
+ return thisTab;
|
+ return thisTab;
|
||||||
+ }
|
+ }
|
||||||
+ return;
|
|
||||||
+ }
|
+ }
|
||||||
// Swap the dropped tab with a new one we create and then close
|
// Swap the dropped tab with a new one we create and then close
|
||||||
// it in the other window (making it seem to have moved between
|
// it in the other window (making it seem to have moved between
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ class ZenStartup {
|
|||||||
await delayedStartupPromise;
|
await delayedStartupPromise;
|
||||||
await SessionStore.promiseAllWindowsRestored;
|
await SessionStore.promiseAllWindowsRestored;
|
||||||
delete gZenUIManager.promiseInitialized;
|
delete gZenUIManager.promiseInitialized;
|
||||||
this.#initSearchBar();
|
|
||||||
gZenCompactModeManager.init();
|
gZenCompactModeManager.init();
|
||||||
// Fix for https://github.com/zen-browser/desktop/issues/7605, specially in compact mode
|
// Fix for https://github.com/zen-browser/desktop/issues/7605, specially in compact mode
|
||||||
if (gURLBar.hasAttribute("breakout-extend")) {
|
if (gURLBar.hasAttribute("breakout-extend")) {
|
||||||
@@ -154,11 +153,6 @@ class ZenStartup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#initSearchBar() {
|
|
||||||
// Only focus the url bar
|
|
||||||
gURLBar.focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
#checkForWelcomePage() {
|
#checkForWelcomePage() {
|
||||||
if (!Services.prefs.getBoolPref("zen.welcome-screen.seen", false)) {
|
if (!Services.prefs.getBoolPref("zen.welcome-screen.seen", false)) {
|
||||||
Services.prefs.setBoolPref("zen.welcome-screen.seen", true);
|
Services.prefs.setBoolPref("zen.welcome-screen.seen", true);
|
||||||
|
|||||||
@@ -891,8 +891,8 @@ window.gZenVerticalTabsManager = {
|
|||||||
marginBottom: isLastItem() ? ["0px", "0px"] : [transform, "0px"],
|
marginBottom: isLastItem() ? ["0px", "0px"] : [transform, "0px"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
duration: 0.11,
|
duration: 0.075,
|
||||||
easing: "ease-out",
|
easing: "easeOut",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
@@ -913,8 +913,8 @@ window.gZenVerticalTabsManager = {
|
|||||||
filter: ["blur(1px)", "blur(0px)"],
|
filter: ["blur(1px)", "blur(0px)"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
duration: 0.11,
|
duration: 0.075,
|
||||||
easing: "ease-out",
|
easing: "easeOut",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
@@ -949,7 +949,7 @@ window.gZenVerticalTabsManager = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
duration: 0.075,
|
duration: 0.075,
|
||||||
easing: "ease-out",
|
easing: "easeOut",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -678,6 +678,7 @@
|
|||||||
clientX < 0 || clientX > innerWidth || clientY < 0 || clientY > innerHeight;
|
clientX < 0 || clientX > innerWidth || clientY < 0 || clientY > innerHeight;
|
||||||
if (isOutOfWindow && !this.#isOutOfWindow) {
|
if (isOutOfWindow && !this.#isOutOfWindow) {
|
||||||
this.#isOutOfWindow = true;
|
this.#isOutOfWindow = true;
|
||||||
|
gZenViewSplitter.onBrowserDragEndToSplit(event, true);
|
||||||
this.#maybeClearVerticalPinnedGridDragOver();
|
this.#maybeClearVerticalPinnedGridDragOver();
|
||||||
this.clearSpaceSwitchTimer();
|
this.clearSpaceSwitchTimer();
|
||||||
this.clearDragOverVisuals();
|
this.clearDragOverVisuals();
|
||||||
@@ -716,20 +717,22 @@
|
|||||||
const dt = event.dataTransfer;
|
const dt = event.dataTransfer;
|
||||||
const activeWorkspace = gZenWorkspaces.activeWorkspace;
|
const activeWorkspace = gZenWorkspaces.activeWorkspace;
|
||||||
let draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
|
let draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
|
||||||
if (
|
if (draggedTab.ownerGlobal === window) {
|
||||||
isTab(draggedTab) &&
|
if (
|
||||||
!draggedTab.hasAttribute("zen-essential") &&
|
isTab(draggedTab) &&
|
||||||
draggedTab.getAttribute("zen-workspace-id") != activeWorkspace
|
!draggedTab.hasAttribute("zen-essential") &&
|
||||||
) {
|
draggedTab.getAttribute("zen-workspace-id") != activeWorkspace
|
||||||
const movingTabs = draggedTab._dragData?.movingTabs || [draggedTab];
|
) {
|
||||||
for (let tab of movingTabs) {
|
const movingTabs = draggedTab._dragData?.movingTabs || [draggedTab];
|
||||||
tab.setAttribute("zen-workspace-id", activeWorkspace);
|
for (let tab of movingTabs) {
|
||||||
|
tab.setAttribute("zen-workspace-id", activeWorkspace);
|
||||||
|
}
|
||||||
|
gBrowser.selectedTab = draggedTab;
|
||||||
|
}
|
||||||
|
if (isTabGroupLabel(draggedTab)) {
|
||||||
|
draggedTab = draggedTab.group;
|
||||||
|
gZenFolders.changeFolderToSpace(draggedTab, activeWorkspace, { hasDndSwitch: true });
|
||||||
}
|
}
|
||||||
gBrowser.selectedTab = draggedTab;
|
|
||||||
}
|
|
||||||
if (isTabGroupLabel(draggedTab)) {
|
|
||||||
draggedTab = draggedTab.group;
|
|
||||||
gZenFolders.changeFolderToSpace(draggedTab, activeWorkspace, { hasDndSwitch: true });
|
|
||||||
}
|
}
|
||||||
gZenWorkspaces.updateTabsContainers();
|
gZenWorkspaces.updateTabsContainers();
|
||||||
}
|
}
|
||||||
@@ -928,7 +931,7 @@
|
|||||||
if (event.target.classList.contains("zen-workspace-empty-space") || hoveringPeriphery) {
|
if (event.target.classList.contains("zen-workspace-empty-space") || hoveringPeriphery) {
|
||||||
let lastTab = gBrowser.tabs.at(-1);
|
let lastTab = gBrowser.tabs.at(-1);
|
||||||
dropElement =
|
dropElement =
|
||||||
(hoveringPeriphery
|
(hoveringPeriphery && Services.prefs.getBoolPref("zen.view.show-newtab-button-top")
|
||||||
? this._tabbrowserTabs.ariaFocusableItems.at(
|
? this._tabbrowserTabs.ariaFocusableItems.at(
|
||||||
gBrowser._numVisiblePinTabsWithoutCollapsed
|
gBrowser._numVisiblePinTabsWithoutCollapsed
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1038,43 +1038,47 @@ class nsZenFolders extends nsZenDOMOperatedFeature {
|
|||||||
const tabFolderWorkingData = new Map();
|
const tabFolderWorkingData = new Map();
|
||||||
|
|
||||||
for (const folderData of data) {
|
for (const folderData of data) {
|
||||||
const workingData = {
|
try {
|
||||||
stateData: folderData,
|
const workingData = {
|
||||||
node: null,
|
stateData: folderData,
|
||||||
containingTabsFragment: document.createDocumentFragment(),
|
node: null,
|
||||||
};
|
containingTabsFragment: document.createDocumentFragment(),
|
||||||
tabFolderWorkingData.set(folderData.id, workingData);
|
};
|
||||||
|
tabFolderWorkingData.set(folderData.id, workingData);
|
||||||
|
|
||||||
const oldGroup = document.getElementById(folderData.id);
|
const oldGroup = document.getElementById(folderData.id);
|
||||||
folderData.emptyTabIds.forEach((id) => {
|
folderData.emptyTabIds.forEach((id) => {
|
||||||
oldGroup?.querySelector(`tab[id="${id}"]`)?.setAttribute("zen-empty-tab", true);
|
oldGroup?.querySelector(`tab[id="${id}"]`)?.setAttribute("zen-empty-tab", true);
|
||||||
});
|
});
|
||||||
if (gBrowser.isTabGroup(oldGroup)) {
|
if (gBrowser.isTabGroup(oldGroup)) {
|
||||||
if (!folderData.splitViewGroup) {
|
if (!folderData.splitViewGroup) {
|
||||||
const folder = this._createFolderNode({
|
const folder = this._createFolderNode({
|
||||||
id: folderData.id,
|
id: folderData.id,
|
||||||
label: folderData.name,
|
label: folderData.name,
|
||||||
collapsed: folderData.collapsed,
|
collapsed: folderData.collapsed,
|
||||||
pinned: folderData.pinned,
|
pinned: folderData.pinned,
|
||||||
saveOnWindowClose: folderData.saveOnWindowClose,
|
saveOnWindowClose: folderData.saveOnWindowClose,
|
||||||
workspaceId: folderData.workspaceId,
|
workspaceId: folderData.workspaceId,
|
||||||
});
|
});
|
||||||
folder.setAttribute("id", folderData.id);
|
folder.setAttribute("id", folderData.id);
|
||||||
workingData.node = folder;
|
workingData.node = folder;
|
||||||
oldGroup.before(folder);
|
oldGroup.before(folder);
|
||||||
} else {
|
} else {
|
||||||
workingData.node = oldGroup;
|
workingData.node = oldGroup;
|
||||||
}
|
}
|
||||||
while (oldGroup.tabs.length) {
|
while (oldGroup.tabs.length) {
|
||||||
const tab = oldGroup.tabs[0];
|
const tab = oldGroup.tabs[0];
|
||||||
if (folderData.workspaceId) {
|
if (folderData.workspaceId) {
|
||||||
tab.setAttribute("zen-workspace-id", folderData.workspaceId);
|
tab.setAttribute("zen-workspace-id", folderData.workspaceId);
|
||||||
|
}
|
||||||
|
workingData.containingTabsFragment.appendChild(tab);
|
||||||
|
}
|
||||||
|
if (!folderData.splitViewGroup) {
|
||||||
|
oldGroup.remove();
|
||||||
}
|
}
|
||||||
workingData.containingTabsFragment.appendChild(tab);
|
|
||||||
}
|
|
||||||
if (!folderData.splitViewGroup) {
|
|
||||||
oldGroup.remove();
|
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Error restoring Zen Folders session data:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,19 @@ export class nsZenSessionManager {
|
|||||||
folderIcon: row.getResultByName("folder_icon"),
|
folderIcon: row.getResultByName("folder_icon"),
|
||||||
isFolderCollapsed: Boolean(row.getResultByName("is_folder_collapsed")),
|
isFolderCollapsed: Boolean(row.getResultByName("is_folder_collapsed")),
|
||||||
}));
|
}));
|
||||||
|
try {
|
||||||
|
data.recoveryData = await IOUtils.readJSON(
|
||||||
|
PathUtils.join(
|
||||||
|
Services.dirsvc.get("ProfD", Ci.nsIFile).path,
|
||||||
|
"sessionstore-backups",
|
||||||
|
"recovery.jsonlz4"
|
||||||
|
),
|
||||||
|
{ decompress: true }
|
||||||
|
);
|
||||||
|
this.log("Recovered recovery data from sessionstore-backups");
|
||||||
|
} catch {
|
||||||
|
/* ignore errors reading recovery data */
|
||||||
|
}
|
||||||
this._migrationData = data;
|
this._migrationData = data;
|
||||||
} catch {
|
} catch {
|
||||||
/* ignore errors during migration */
|
/* ignore errors during migration */
|
||||||
@@ -298,6 +311,11 @@ export class nsZenSessionManager {
|
|||||||
initialState?.lastSessionState,
|
initialState?.lastSessionState,
|
||||||
this._migrationData
|
this._migrationData
|
||||||
);
|
);
|
||||||
|
if (!initialState?.windows?.length && this._migrationData?.recoveryData) {
|
||||||
|
this.log("Using recovery data for migration");
|
||||||
|
initialState = this._migrationData.recoveryData;
|
||||||
|
}
|
||||||
|
delete this._migrationData?.recoveryData;
|
||||||
// Restore spaces into the sidebar object if we don't
|
// Restore spaces into the sidebar object if we don't
|
||||||
// have any yet.
|
// have any yet.
|
||||||
if (!this.#sidebar.spaces?.length) {
|
if (!this.#sidebar.spaces?.length) {
|
||||||
|
|||||||
@@ -2093,48 +2093,52 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
|
|||||||
this._sessionRestoring = true;
|
this._sessionRestoring = true;
|
||||||
|
|
||||||
for (const groupData of data) {
|
for (const groupData of data) {
|
||||||
const group = document.getElementById(groupData.groupId);
|
try {
|
||||||
if (!gBrowser.isTabGroup(group)) {
|
const group = document.getElementById(groupData.groupId);
|
||||||
continue;
|
if (!gBrowser.isTabGroup(group)) {
|
||||||
}
|
continue;
|
||||||
|
|
||||||
// Backwards compatibility
|
|
||||||
group.setAttribute("split-view-group", "true");
|
|
||||||
if (!groupData?.layoutTree) {
|
|
||||||
this.splitTabs(group.tabs, group.gridType);
|
|
||||||
delete this._sessionRestoring;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const deserializeNode = (nodeData) => {
|
|
||||||
if (nodeData.type === "leaf") {
|
|
||||||
const tab = document.getElementById(nodeData.tabId);
|
|
||||||
if (!tab) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new nsSplitLeafNode(tab, nodeData.sizeInParent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const splitter = new nsSplitNode(nodeData.direction, nodeData.sizeInParent);
|
// Backwards compatibility
|
||||||
splitter._children = [];
|
group.setAttribute("split-view-group", "true");
|
||||||
|
if (!groupData?.layoutTree) {
|
||||||
for (const childData of nodeData.children) {
|
this.splitTabs(group.tabs, group.gridType);
|
||||||
const childNode = deserializeNode(childData);
|
delete this._sessionRestoring;
|
||||||
if (childNode) {
|
return;
|
||||||
childNode.parent = splitter;
|
|
||||||
splitter._children.push(childNode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return splitter;
|
const deserializeNode = (nodeData) => {
|
||||||
};
|
if (nodeData.type === "leaf") {
|
||||||
|
const tab = document.getElementById(nodeData.tabId);
|
||||||
|
if (!tab) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new nsSplitLeafNode(tab, nodeData.sizeInParent);
|
||||||
|
}
|
||||||
|
|
||||||
const layout = deserializeNode(groupData.layoutTree);
|
const splitter = new nsSplitNode(nodeData.direction, nodeData.sizeInParent);
|
||||||
const splitData = this.splitTabs(group.tabs, groupData.gridType, -1);
|
splitter._children = [];
|
||||||
if (splitData) {
|
|
||||||
splitData.layoutTree = layout;
|
for (const childData of nodeData.children) {
|
||||||
} else {
|
const childNode = deserializeNode(childData);
|
||||||
gBrowser.removeTabGroup(group);
|
if (childNode) {
|
||||||
|
childNode.parent = splitter;
|
||||||
|
splitter._children.push(childNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return splitter;
|
||||||
|
};
|
||||||
|
|
||||||
|
const layout = deserializeNode(groupData.layoutTree);
|
||||||
|
const splitData = this.splitTabs(group.tabs, groupData.gridType, -1);
|
||||||
|
if (splitData) {
|
||||||
|
splitData.layoutTree = layout;
|
||||||
|
} else {
|
||||||
|
gBrowser.removeTabGroup(group);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Error restoring split view session data:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -603,7 +603,10 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
|
|||||||
let isRegularTabs = false;
|
let isRegularTabs = false;
|
||||||
// Check for essentials container
|
// Check for essentials container
|
||||||
if (essentialTabsTarget) {
|
if (essentialTabsTarget) {
|
||||||
if (!draggedTab.hasAttribute("zen-essential") && !draggedTab?.group) {
|
if (
|
||||||
|
!draggedTab.hasAttribute("zen-essential") &&
|
||||||
|
!draggedTab?.group?.hasAttribute("split-view-group")
|
||||||
|
) {
|
||||||
moved = true;
|
moved = true;
|
||||||
isVertical = false;
|
isVertical = false;
|
||||||
hasActuallyMoved = this.addToEssentials(draggedTab);
|
hasActuallyMoved = this.addToEssentials(draggedTab);
|
||||||
|
|||||||
@@ -807,7 +807,7 @@ class nsZenWorkspaces {
|
|||||||
chromeFlags & Ci.nsIWebBrowserChrome.CHROME_MENUBAR;
|
chromeFlags & Ci.nsIWebBrowserChrome.CHROME_MENUBAR;
|
||||||
return this._shouldHaveWorkspaces;
|
return this._shouldHaveWorkspaces;
|
||||||
}
|
}
|
||||||
return this._shouldHaveWorkspaces;
|
return this._shouldHaveWorkspaces && !document.documentElement.hasAttribute("taskbartab");
|
||||||
}
|
}
|
||||||
|
|
||||||
get isPrivateWindow() {
|
get isPrivateWindow() {
|
||||||
@@ -1044,11 +1044,17 @@ class nsZenWorkspaces {
|
|||||||
delete this._initialTab;
|
delete this._initialTab;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gZenVerticalTabsManager._canReplaceNewTab && showed) {
|
// Wait for the next event loop to ensure that the startup focus logic by
|
||||||
BrowserCommands.openTab();
|
// firefox has finished doing it's thing.
|
||||||
} else if (!showed) {
|
setTimeout(() => {
|
||||||
gBrowser.selectedBrowser.focus();
|
setTimeout(() => {
|
||||||
}
|
if (gZenVerticalTabsManager._canReplaceNewTab && showed) {
|
||||||
|
BrowserCommands.openTab();
|
||||||
|
} else if (!showed) {
|
||||||
|
gBrowser.selectedBrowser.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!gZenVerticalTabsManager._canReplaceNewTab &&
|
!gZenVerticalTabsManager._canReplaceNewTab &&
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
"brandShortName": "Zen",
|
"brandShortName": "Zen",
|
||||||
"brandFullName": "Zen Browser",
|
"brandFullName": "Zen Browser",
|
||||||
"release": {
|
"release": {
|
||||||
"displayVersion": "1.18.2b",
|
"displayVersion": "1.18.3b",
|
||||||
"github": {
|
"github": {
|
||||||
"repo": "zen-browser/desktop"
|
"repo": "zen-browser/desktop"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user