diff --git a/browser/components/sessionstore/src/nsSessionStore.js b/browser/components/sessionstore/src/nsSessionStore.js index 5066f00e93a..9532fcfeb02 100644 --- a/browser/components/sessionstore/src/nsSessionStore.js +++ b/browser/components/sessionstore/src/nsSessionStore.js @@ -1065,6 +1065,14 @@ SessionStoreService.prototype = { if (length > maxTabsUndo) this._windows[aWindow.__SSi]._closedTabs.splice(maxTabsUndo, length - maxTabsUndo); } + + // Remove the tab from the saved window state if it matches what is already + // there. This solves bug 677424 + if (aTab._tPos < this._windows[aWindow.__SSi].tabs.length) { + var oldTab = this._windows[aWindow.__SSi].tabs[aTab._tPos]; + if (oldTab.entries[oldTab.index - 1].url == aTab.linkedBrowser.currentURI.spec) + this._windows[aWindow.__SSi].tabs.splice(aTab._tPos, 1); + } }, /**