diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index d798611c..8a2d2041 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -144,6 +144,20 @@ var TreeStyleTabService = { ) ); + if ('undoCloseTab' in window) { + eval('window.undoCloseTab = '+ + window.undoCloseTab.toSource().replace( + /(\btab\s*=\s*[^\.]+\.undoCloseTab\([^;]+\);)/, + + ) + ); + } + this.overrideExtensionsPreInit(); // hacks.js this.registerTabFocusAllowance(this.defaultTabFocusAllowance); diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 3730ac2e..92b9bc10 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -2184,6 +2184,8 @@ TreeStyleTabBrowser.prototype = { { var behavior = this.undoCloseTabSetBehavior(0, true); if ( + aRestoredTab.__treestyletab__restoredByUndoCloseTab || + !this.browser.__treestyletab__readyToUndoCloseTab || this.useTMPSessionAPI || this._restoringClosedSet || !(behavior & this.kUNDO_CLOSE_SET || behavior & this.kUNDO_ASK) @@ -2237,6 +2239,8 @@ TreeStyleTabBrowser.prototype = { onTabRestored : function TSTBrowser_onTabRestored(aEvent) { + delete aEvent.originalTarget.__treestyletab__restoredByUndoCloseTab; + // update the status for the next restoring if (!this.useTMPSessionAPI && TreeStyleTabService.restoringWindow) TreeStyleTabService.restoringWindow = TreeStyleTabService.getRestoringTabsCount() > 0;