diff --git a/browser/components/sessionstore/SessionStore.jsm b/browser/components/sessionstore/SessionStore.jsm index 2980b5f472aa..e3763888fdcc 100644 --- a/browser/components/sessionstore/SessionStore.jsm +++ b/browser/components/sessionstore/SessionStore.jsm @@ -3492,9 +3492,17 @@ var SessionStoreInternal = { this._windows[aWindow.__SSi].selected = aSelectTab; } + // If we restore the selected tab, make sure it goes first. + let selectedIndex = aTabs.indexOf(tabbrowser.selectedTab); + if (selectedIndex > -1) { + this.restoreTab(tabbrowser.selectedTab, aTabData[selectedIndex]); + } + // Restore all tabs. for (let t = 0; t < aTabs.length; t++) { - this.restoreTab(aTabs[t], aTabData[t]); + if (t != selectedIndex) { + this.restoreTab(aTabs[t], aTabData[t]); + } } },