no-bug: Fix all patches

This commit is contained in:
mr. m
2026-03-20 00:14:12 +01:00
parent 820d795bd1
commit ba429b5b41
119 changed files with 684 additions and 1260 deletions

View File

@@ -1,18 +1,18 @@
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf06644d92 100644
index 3bebeb70e1a88aefb3ef4bc2114bd85b0d8d1e51..5414adeca242f00bff98c5e41de74f33dd2846bb 100644
--- a/browser/components/sessionstore/SessionStore.sys.mjs
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -127,6 +127,9 @@ const TAB_EVENTS = [
"TabGroupCollapse",
"TabGroupExpand",
@@ -129,6 +129,9 @@ const TAB_EVENTS = [
"TabSplitViewActivate",
"SplitViewRemoved",
"SplitViewCreated",
+ "TabAddedToEssentials",
+ "TabRemovedFromEssentials",
+ "ZenWorkspaceDataChanged",
];
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@@ -198,6 +201,8 @@ ChromeUtils.defineESModuleGetters(lazy, {
@@ -200,6 +203,8 @@ ChromeUtils.defineESModuleGetters(lazy, {
TabStateCache: "resource:///modules/sessionstore/TabStateCache.sys.mjs",
TabStateFlusher: "resource:///modules/sessionstore/TabStateFlusher.sys.mjs",
setTimeout: "resource://gre/modules/Timer.sys.mjs",
@@ -21,7 +21,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
});
ChromeUtils.defineLazyGetter(lazy, "blankURI", () => {
@@ -1263,10 +1268,7 @@ var SessionStoreInternal = {
@@ -1292,10 +1297,7 @@ var SessionStoreInternal = {
*/
get willAutoRestore() {
return (
@@ -33,7 +33,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
);
},
@@ -1940,6 +1942,9 @@ var SessionStoreInternal = {
@@ -1972,6 +1974,9 @@ var SessionStoreInternal = {
case "TabPinned":
case "TabUnpinned":
case "SwapDocShells":
@@ -43,7 +43,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
this.saveStateDelayed(win);
break;
case "TabGroupCreate":
@@ -2050,6 +2055,10 @@ var SessionStoreInternal = {
@@ -2085,6 +2090,10 @@ var SessionStoreInternal = {
this._windows[aWindow.__SSi].isTaskbarTab = true;
}
@@ -54,7 +54,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
if (lazy.AIWindow.isAIWindowActiveAndEnabled(aWindow)) {
this._windows[aWindow.__SSi].isAIWindow = true;
}
@@ -2086,7 +2095,7 @@ var SessionStoreInternal = {
@@ -2121,7 +2130,7 @@ var SessionStoreInternal = {
let isTaskbarTab = this._windows[aWindow.__SSi].isTaskbarTab;
// A regular window is not a private window, taskbar tab window, or popup window
let isRegularWindow =
@@ -63,7 +63,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
// perform additional initialization when the first window is loading
if (lazy.RunState.isStopped) {
@@ -2098,7 +2107,7 @@ var SessionStoreInternal = {
@@ -2133,7 +2142,7 @@ var SessionStoreInternal = {
// to disk to NOW() to enforce a full interval before the next write.
lazy.SessionSaver.updateLastSaveTime();
@@ -72,7 +72,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
this._log.debug(
"initializeWindow, the window is private or a web app. Saving SessionStartup.state for possibly restoring later"
);
@@ -2141,6 +2150,7 @@ var SessionStoreInternal = {
@@ -2176,6 +2185,7 @@ var SessionStoreInternal = {
null,
"sessionstore-one-or-no-tab-restored"
);
@@ -80,7 +80,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
this._deferredAllWindowsRestored.resolve();
}
// this window was opened by _openWindowWithState
@@ -2190,7 +2200,6 @@ var SessionStoreInternal = {
@@ -2225,7 +2235,6 @@ var SessionStoreInternal = {
if (closedWindowState) {
let newWindowState;
if (
@@ -88,7 +88,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
!lazy.SessionStartup.willRestore()
) {
// We want to split the window up into pinned tabs and unpinned tabs.
@@ -2226,6 +2235,7 @@ var SessionStoreInternal = {
@@ -2261,6 +2270,7 @@ var SessionStoreInternal = {
}
if (newWindowState) {
@@ -96,7 +96,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
// Ensure that the window state isn't hidden
this._restoreCount = 1;
let state = { windows: [newWindowState] };
@@ -2254,6 +2264,15 @@ var SessionStoreInternal = {
@@ -2289,6 +2299,15 @@ var SessionStoreInternal = {
});
this._shouldRestoreLastSession = false;
}
@@ -112,7 +112,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
if (this._restoreLastWindow && aWindow.toolbar.visible) {
// always reset (if not a popup window)
@@ -2404,7 +2423,7 @@ var SessionStoreInternal = {
@@ -2439,7 +2458,7 @@ var SessionStoreInternal = {
var tabbrowser = aWindow.gBrowser;
@@ -121,7 +121,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
TAB_EVENTS.forEach(function (aEvent) {
tabbrowser.tabContainer.removeEventListener(aEvent, this, true);
@@ -2455,7 +2474,7 @@ var SessionStoreInternal = {
@@ -2490,7 +2509,7 @@ var SessionStoreInternal = {
let isLastRegularWindow =
Object.values(this._windows).filter(
@@ -130,7 +130,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
).length == 1;
this._log.debug(
`onClose, closing window isLastRegularWindow? ${isLastRegularWindow}`
@@ -2512,8 +2531,8 @@ var SessionStoreInternal = {
@@ -2547,8 +2566,8 @@ var SessionStoreInternal = {
// 2) Flush the window.
// 3) When the flush is complete, revisit our decision to store the window
// in _closedWindows, and add/remove as necessary.
@@ -141,7 +141,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
}
completionPromise = lazy.TabStateFlusher.flushWindow(aWindow).then(() => {
@@ -2533,8 +2552,9 @@ var SessionStoreInternal = {
@@ -2568,8 +2587,9 @@ var SessionStoreInternal = {
// Save non-private windows if they have at
// least one saveable tab or are the last window.
@@ -153,7 +153,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
if (!isLastWindow && winData.closedId > -1) {
this._addClosedAction(
@@ -2610,7 +2630,7 @@ var SessionStoreInternal = {
@@ -2645,7 +2665,7 @@ var SessionStoreInternal = {
* to call this method again asynchronously (for example, after
* a window flush).
*/
@@ -162,7 +162,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
// Make sure SessionStore is still running, and make sure that we
// haven't chosen to forget this window.
if (
@@ -2627,6 +2647,7 @@ var SessionStoreInternal = {
@@ -2662,6 +2682,7 @@ var SessionStoreInternal = {
// _closedWindows from a previous call to this function.
let winIndex = this._closedWindows.indexOf(winData);
let alreadyStored = winIndex != -1;
@@ -170,7 +170,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
// If sidebar command is truthy, i.e. sidebar is open, store sidebar settings
let shouldStore = hasSaveableTabs || isLastWindow;
@@ -3429,7 +3450,7 @@ var SessionStoreInternal = {
@@ -3483,7 +3504,7 @@ var SessionStoreInternal = {
if (!isPrivateWindow && tabState.isPrivate) {
return;
}
@@ -179,7 +179,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
return;
}
@@ -4150,6 +4171,12 @@ var SessionStoreInternal = {
@@ -4223,6 +4244,12 @@ var SessionStoreInternal = {
Math.min(tabState.index, tabState.entries.length)
);
tabState.pinned = false;
@@ -192,7 +192,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
if (inBackground === false) {
aWindow.gBrowser.selectedTab = newTab;
@@ -4586,6 +4613,8 @@ var SessionStoreInternal = {
@@ -4659,6 +4686,8 @@ var SessionStoreInternal = {
// Append the tab if we're opening into a different window,
tabIndex: aSource == aTargetWindow ? pos : Infinity,
pinned: state.pinned,
@@ -201,7 +201,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
userContextId: state.userContextId,
skipLoad: true,
preferredRemoteType,
@@ -5087,9 +5116,10 @@ var SessionStoreInternal = {
@@ -5160,9 +5189,10 @@ var SessionStoreInternal = {
if (activePageData.title && activePageData.title != activePageData.url) {
win.gBrowser.setInitialTabTitle(tab, activePageData.title, {
isContentTitle: true,
@@ -213,7 +213,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
}
}
@@ -5446,7 +5476,7 @@ var SessionStoreInternal = {
@@ -5527,7 +5557,7 @@ var SessionStoreInternal = {
for (let i = tabbrowser.pinnedTabCount; i < tabbrowser.tabs.length; i++) {
let tab = tabbrowser.tabs[i];
@@ -222,7 +222,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
removableTabs.push(tab);
}
}
@@ -5559,7 +5589,7 @@ var SessionStoreInternal = {
@@ -5640,7 +5670,7 @@ var SessionStoreInternal = {
// collect the data for all windows
for (ix in this._windows) {
@@ -231,7 +231,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
// window data is still in _statesToRestore
continue;
}
@@ -5702,11 +5732,12 @@ var SessionStoreInternal = {
@@ -5784,11 +5814,12 @@ var SessionStoreInternal = {
}
let tabbrowser = aWindow.gBrowser;
@@ -245,7 +245,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
// update the internal state data for this window
for (let tab of tabs) {
if (tab == aWindow.FirefoxViewHandler.tab) {
@@ -5717,6 +5748,9 @@ var SessionStoreInternal = {
@@ -5799,6 +5830,9 @@ var SessionStoreInternal = {
tabsData.push(tabData);
}
@@ -255,7 +255,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
// update tab group state for this window
winData.groups = [];
for (let tabGroup of aWindow.gBrowser.tabGroups) {
@@ -5729,7 +5763,7 @@ var SessionStoreInternal = {
@@ -5815,7 +5849,7 @@ var SessionStoreInternal = {
// a window is closed, point to the first item in the tab strip instead (it will never be the Firefox View tab,
// since it's only inserted into the tab strip after it's selected).
if (aWindow.FirefoxViewHandler.tab?.selected) {
@@ -264,7 +264,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
winData.title = tabbrowser.tabs[0].label;
}
winData.selected = selectedIndex;
@@ -5844,8 +5878,8 @@ var SessionStoreInternal = {
@@ -6017,8 +6051,8 @@ var SessionStoreInternal = {
// selectTab represents.
let selectTab = 0;
if (overwriteTabs) {
@@ -275,7 +275,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
selectTab = Math.min(selectTab, winData.tabs.length);
}
@@ -5867,6 +5901,7 @@ var SessionStoreInternal = {
@@ -6040,6 +6074,7 @@ var SessionStoreInternal = {
if (overwriteTabs) {
for (let i = tabbrowser.browsers.length - 1; i >= 0; i--) {
if (!tabbrowser.tabs[i].selected) {
@@ -283,7 +283,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
tabbrowser.removeTab(tabbrowser.tabs[i]);
}
}
@@ -5900,6 +5935,12 @@ var SessionStoreInternal = {
@@ -6074,6 +6109,12 @@ var SessionStoreInternal = {
savedTabGroup => !openTabGroupIdsInWindow.has(savedTabGroup.id)
);
}
@@ -296,7 +296,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
// Move the originally open tabs to the end.
if (initialTabs) {
@@ -6453,6 +6494,25 @@ var SessionStoreInternal = {
@@ -6638,6 +6679,25 @@ var SessionStoreInternal = {
// Most of tabData has been restored, now continue with restoring
// attributes that may trigger external events.
@@ -322,7 +322,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
if (tabData.pinned) {
tabbrowser.pinTab(tab);
@@ -6601,6 +6661,9 @@ var SessionStoreInternal = {
@@ -6797,6 +6857,9 @@ var SessionStoreInternal = {
aWindow.gURLBar.readOnly = false;
}
}
@@ -332,7 +332,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
let promiseParts = Promise.withResolvers();
aWindow.setTimeout(() => {
@@ -7389,7 +7452,7 @@ var SessionStoreInternal = {
@@ -7592,7 +7655,7 @@ var SessionStoreInternal = {
let groupsToSave = new Map();
for (let tIndex = 0; tIndex < window.tabs.length; ) {
@@ -341,7 +341,7 @@ index f066bc7a9cca1788080d088141030c225a733931..accb078ebbc23f9a823ae6c277f1e1bf
// Adjust window.selected
if (tIndex + 1 < window.selected) {
window.selected -= 1;
@@ -7404,7 +7467,7 @@ var SessionStoreInternal = {
@@ -7607,7 +7670,7 @@ var SessionStoreInternal = {
);
// We don't want to increment tIndex here.
continue;

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/sessionstore/TabGroupState.sys.mjs b/browser/components/sessionstore/TabGroupState.sys.mjs
index 934326aefc80479a2ca2ee9e376375f117512b4d..db840ead9ab53849f8f1f33864972347d43f9398 100644
index 1289549cf33ce6efb620c877bd1ba1c24475d2b0..4c34c923f4b129dd9ea79414d978c6432317340c 100644
--- a/browser/components/sessionstore/TabGroupState.sys.mjs
+++ b/browser/components/sessionstore/TabGroupState.sys.mjs
@@ -62,6 +62,9 @@ class _TabGroupState {
@@ -65,6 +65,9 @@ class _TabGroupState {
*/
collect(tabGroup) {
return {

View File

@@ -1,9 +1,9 @@
diff --git a/browser/components/sessionstore/TabState.sys.mjs b/browser/components/sessionstore/TabState.sys.mjs
index 82721356d191055bec0d4b0ca49e481221988801..e01904a6ea73e068c236adecbac6a97adedb2bd3 100644
index eb24c3ffdd2cfb33379aca993af5171fdb91ac2c..15d3fbff397df23f112355e22ca5dba5bf29528f 100644
--- a/browser/components/sessionstore/TabState.sys.mjs
+++ b/browser/components/sessionstore/TabState.sys.mjs
@@ -85,7 +85,25 @@ class _TabState {
tabData.groupId = tab.group.id;
@@ -99,7 +99,25 @@ class _TabState {
}
}
+ tabData.zenWorkspace = tab.getAttribute("zen-workspace-id");