diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml index 33bb5d4f0a9..3d05da187c2 100644 --- a/toolkit/content/widgets/browser.xml +++ b/toolkit/content/widgets/browser.xml @@ -622,6 +622,14 @@ if (aTopic != "browser:purge-session-history") return; + // place the entry at current index at the end of the history list, so it won't get removed + if (this.sessionHistory.index < this.sessionHistory.count - 1) { + var indexEntry = this.sessionHistory.getEntryAtIndex(this.sessionHistory.index, false); + this.sessionHistory.QueryInterface(Components.interfaces.nsISHistoryInternal); + indexEntry.QueryInterface(Components.interfaces.nsISHEntry); + this.sessionHistory.addEntry(indexEntry, true); + } + var purge = this.sessionHistory.count; if (this.currentURI != "about:blank") --purge; // Don't remove the page the user's staring at from shistory