commit 99203aa5489d03818338d2203c9f61b3b374f01a
parent 138d9ef3ca8b830d9cdc57e23cbf7a37c6681fa9
Author: Daniel <90185651+dan-singer-aus@users.noreply.github.com>
Date: Thu, 18 Dec 2025 17:39:47 +0000
Bug 1916884 - Restore Last closed tab into the active browser window. r=sessionstore-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D274549
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/browser/components/sessionstore/SessionWindowUI.sys.mjs b/browser/components/sessionstore/SessionWindowUI.sys.mjs
@@ -24,13 +24,16 @@ export var SessionWindowUI = {
*/
restoreLastClosedTabOrWindowOrSession(window) {
let lastActionTaken = lazy.SessionStore.popLastClosedAction();
-
if (lastActionTaken) {
switch (lastActionTaken.type) {
- case lazy.SessionStore.LAST_ACTION_CLOSED_TAB: {
- this.undoCloseTab(window);
+ case lazy.SessionStore.LAST_ACTION_CLOSED_TAB:
+ {
+ const sourceWindow = lazy.SessionStore.getWindowForTabClosedId(
+ lastActionTaken.closedId
+ );
+ this.undoCloseTab(window, undefined, sourceWindow?.__SSi);
+ }
break;
- }
case lazy.SessionStore.LAST_ACTION_CLOSED_WINDOW: {
this.undoCloseWindow();
break;