fix: Fixed hyperlinks being removed at startup, b=closes #11639, c=tabs, workspaces

This commit is contained in:
mr. m
2025-12-20 00:18:41 +01:00
parent 59072ee932
commit 3e5c355543
3 changed files with 19 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..61bfa1b530c407dd1236543f785eb22176c60c4e 100644
index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..6894412f5dcf632c1d4c3dabeffabf9e5dd96222 100644
--- a/browser/components/sessionstore/SessionStore.sys.mjs
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -127,6 +127,8 @@ const TAB_EVENTS = [
@@ -122,7 +122,15 @@ index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..61bfa1b530c407dd1236543f785eb221
selectTab = Math.min(selectTab, winData.tabs.length);
}
@@ -5809,6 +5820,8 @@ var SessionStoreInternal = {
@@ -5788,6 +5799,7 @@ var SessionStoreInternal = {
if (overwriteTabs) {
for (let i = tabbrowser.browsers.length - 1; i >= 0; i--) {
if (!tabbrowser.tabs[i].selected) {
+ aWindow.gZenWorkspaces._shouldOverrideTabs = true;
tabbrowser.removeTab(tabbrowser.tabs[i]);
}
}
@@ -5809,6 +5821,8 @@ var SessionStoreInternal = {
winData.tabs,
winData.groups ?? []
);
@@ -131,7 +139,7 @@ index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..61bfa1b530c407dd1236543f785eb221
this._log.debug(
`restoreWindow, createTabsForSessionRestore returned ${tabs.length} tabs`
);
@@ -6372,6 +6385,25 @@ var SessionStoreInternal = {
@@ -6372,6 +6386,25 @@ var SessionStoreInternal = {
// Most of tabData has been restored, now continue with restoring
// attributes that may trigger external events.
@@ -157,7 +165,7 @@ index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..61bfa1b530c407dd1236543f785eb221
if (tabData.pinned) {
tabbrowser.pinTab(tab);
@@ -7290,7 +7322,7 @@ var SessionStoreInternal = {
@@ -7290,7 +7323,7 @@ var SessionStoreInternal = {
let groupsToSave = new Map();
for (let tIndex = 0; tIndex < window.tabs.length; ) {
@@ -166,7 +174,7 @@ index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..61bfa1b530c407dd1236543f785eb221
// Adjust window.selected
if (tIndex + 1 < window.selected) {
window.selected -= 1;
@@ -7305,7 +7337,7 @@ var SessionStoreInternal = {
@@ -7305,7 +7338,7 @@ var SessionStoreInternal = {
);
// We don't want to increment tIndex here.
continue;

View File

@@ -141,7 +141,10 @@
position: relative;
opacity: 1;
align-items: center;
padding: 0 5px;
@media (-moz-platform: macos) {
padding: 0 5px;
}
& toolbarseparator {
height: 1px;

View File

@@ -973,6 +973,7 @@ class nsZenWorkspaces extends nsZenMultiWindowFeature {
const cleanup = () => {
delete this._tabToSelect;
delete this._tabToRemoveForEmpty;
delete this._shouldOverrideTabs;
resolveSelectPromise();
};
@@ -988,7 +989,7 @@ class nsZenWorkspaces extends nsZenMultiWindowFeature {
delete this._initialTab;
}
if (this._tabToRemoveForEmpty && !removedEmptyTab) {
if (this._tabToRemoveForEmpty && !removedEmptyTab && !this._shouldOverrideTabs) {
const tabs = gBrowser.tabs.filter((tab) => !tab.collapsed);
if (
typeof this._tabToSelect === 'number' &&