diff --git a/browser/base/content/tab-content.js b/browser/base/content/tab-content.js index c4e51951116a..bddc5c5a5718 100644 --- a/browser/base/content/tab-content.js +++ b/browser/base/content/tab-content.js @@ -64,6 +64,7 @@ addMessageListener("Browser:HideSessionRestoreButton", function(message) { }); +// XXX(nika): Should we try to call this in the parent process instead? addMessageListener("Browser:Reload", function(message) { /* First, we'll try to use the session history object to reload so * that framesets are handled properly. If we're in a special @@ -73,9 +74,9 @@ addMessageListener("Browser:Reload", function(message) { let webNav = docShell.QueryInterface(Ci.nsIWebNavigation); try { - let sh = webNav.sessionHistory; - if (sh) - webNav = sh.QueryInterface(Ci.nsIWebNavigation); + if (webNav.sessionHistory) { + webNav = webNav.sessionHistory; + } } catch (e) { } diff --git a/browser/base/content/test/general/browser_e10s_switchbrowser.js b/browser/base/content/test/general/browser_e10s_switchbrowser.js index b119a92774e5..61380ae4044c 100644 --- a/browser/base/content/test/general/browser_e10s_switchbrowser.js +++ b/browser/base/content/test/general/browser_e10s_switchbrowser.js @@ -19,7 +19,7 @@ function get_remote_history(browser) { }; for (let i = 0; i < sessionHistory.count; i++) { - let entry = sessionHistory.getEntryAtIndex(i, false); + let entry = sessionHistory.legacySHistory.getEntryAtIndex(i, false); result.entries.push({ uri: entry.URI.spec, title: entry.title diff --git a/browser/base/content/web-panels.js b/browser/base/content/web-panels.js index 96a42cc02743..04d6d6dbad66 100644 --- a/browser/base/content/web-panels.js +++ b/browser/base/content/web-panels.js @@ -93,6 +93,5 @@ function PanelBrowserStop() { function PanelBrowserReload() { getPanelBrowser().webNavigation .sessionHistory - .QueryInterface(Ci.nsIWebNavigation) .reload(Ci.nsIWebNavigation.LOAD_FLAGS_NONE); } diff --git a/browser/components/sessionstore/ContentRestore.jsm b/browser/components/sessionstore/ContentRestore.jsm index 5e11aa9a14bc..cbb0eb2f92dd 100644 --- a/browser/components/sessionstore/ContentRestore.jsm +++ b/browser/components/sessionstore/ContentRestore.jsm @@ -164,7 +164,7 @@ ContentRestoreInternal.prototype = { this.restoreTabContent(null, false, callbacks.onLoadFinished); }); - webNavigation.sessionHistory.addSHistoryListener(listener); + webNavigation.sessionHistory.legacySHistory.addSHistoryListener(listener); this._historyListener = listener; // Make sure to reset the capabilities and attributes in case this tab gets @@ -203,7 +203,7 @@ ContentRestoreInternal.prototype = { this._tabData = null; let webNavigation = this.docShell.QueryInterface(Ci.nsIWebNavigation); - let history = webNavigation.sessionHistory; + let history = webNavigation.sessionHistory.legacySHistory; // Listen for the tab to finish loading. this.restoreTabContentStarted(finishCallback); @@ -365,7 +365,7 @@ ContentRestoreInternal.prototype = { */ function HistoryListener(docShell, callback) { let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation); - webNavigation.sessionHistory.addSHistoryListener(this); + webNavigation.sessionHistory.legacySHistory.addSHistoryListener(this); this.webNavigation = webNavigation; this.callback = callback; @@ -377,7 +377,7 @@ HistoryListener.prototype = { ]), uninstall() { - let shistory = this.webNavigation.sessionHistory; + let shistory = this.webNavigation.sessionHistory.legacySHistory; if (shistory) { shistory.removeSHistoryListener(this); } diff --git a/browser/components/sessionstore/content/content-sessionStore.js b/browser/components/sessionstore/content/content-sessionStore.js index 7a93061717fd..023f94e6b24f 100644 --- a/browser/components/sessionstore/content/content-sessionStore.js +++ b/browser/components/sessionstore/content/content-sessionStore.js @@ -320,8 +320,8 @@ var SessionHistoryListener = { // waiting to add the listener later because these notifications are cheap. // We will likely only collect once since we are batching collection on // a delay. - docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory. - addSHistoryListener(this); + docShell.QueryInterface(Ci.nsIWebNavigation). + sessionHistory.legacySHistory.addSHistoryListener(this); // Collect data if we start with a non-empty shistory. if (!SessionHistory.isEmpty(docShell)) { @@ -342,7 +342,7 @@ var SessionHistoryListener = { uninit() { let sessionHistory = docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory; if (sessionHistory) { - sessionHistory.removeSHistoryListener(this); + sessionHistory.legacySHistory.removeSHistoryListener(this); } }, diff --git a/browser/components/sessionstore/test/browser_705597.js b/browser/components/sessionstore/test/browser_705597.js index f560d735a6e8..65f7b2e0951f 100644 --- a/browser/components/sessionstore/test/browser_705597.js +++ b/browser/components/sessionstore/test/browser_705597.js @@ -24,7 +24,7 @@ function test() { promiseTabState(tab, tabState).then(() => { let sessionHistory = browser.sessionHistory; - let entry = sessionHistory.getEntryAtIndex(0, false); + let entry = sessionHistory.legacySHistory.getEntryAtIndex(0, false); entry.QueryInterface(Ci.nsISHContainer); whenChildCount(entry, 1, function() { diff --git a/browser/components/sessionstore/test/browser_707862.js b/browser/components/sessionstore/test/browser_707862.js index 527743f871c9..d310a043faea 100644 --- a/browser/components/sessionstore/test/browser_707862.js +++ b/browser/components/sessionstore/test/browser_707862.js @@ -24,14 +24,14 @@ function test() { promiseTabState(tab, tabState).then(() => { let sessionHistory = browser.sessionHistory; - let entry = sessionHistory.getEntryAtIndex(0, false); + let entry = sessionHistory.legacySHistory.getEntryAtIndex(0, false); entry.QueryInterface(Ci.nsISHContainer); whenChildCount(entry, 1, function() { whenChildCount(entry, 2, function() { promiseBrowserLoaded(browser).then(() => { let newSessionHistory = browser.sessionHistory; - let newEntry = newSessionHistory.getEntryAtIndex(0, false); + let newEntry = newSessionHistory.legacySHistory.getEntryAtIndex(0, false); whenChildCount(newEntry, 0, function() { // Make sure that we reset the state. diff --git a/browser/components/sessionstore/test/browser_async_remove_tab.js b/browser/components/sessionstore/test/browser_async_remove_tab.js index a7c289496911..bbe72bb58cfd 100644 --- a/browser/components/sessionstore/test/browser_async_remove_tab.js +++ b/browser/components/sessionstore/test/browser_async_remove_tab.js @@ -35,7 +35,7 @@ function restoreClosedTabWithValue(rval) { function promiseNewLocationAndHistoryEntryReplaced(browser, snippet) { return ContentTask.spawn(browser, snippet, async function(codeSnippet) { let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation); - let shistory = webNavigation.sessionHistory; + let shistory = webNavigation.sessionHistory.legacySHistory; // Evaluate the snippet that the changes the location. // eslint-disable-next-line no-eval @@ -70,7 +70,7 @@ function promiseHistoryEntryReplacedNonRemote(browser) { let {listeners} = promiseHistoryEntryReplacedNonRemote; return new Promise(resolve => { - let shistory = browser.webNavigation.sessionHistory; + let shistory = browser.webNavigation.sessionHistory.legacySHistory; let listener = { OnHistoryReplaceEntry() { diff --git a/browser/components/sessionstore/test/browser_async_window_flushing.js b/browser/components/sessionstore/test/browser_async_window_flushing.js index c0f69308fb48..258e22f09c9f 100644 --- a/browser/components/sessionstore/test/browser_async_window_flushing.js +++ b/browser/components/sessionstore/test/browser_async_window_flushing.js @@ -109,7 +109,7 @@ add_task(async function test_remove_uninteresting_window() { docShell.setCurrentURI(Services.io.newURI("about:blank")); let {sessionHistory} = docShell.QueryInterface(Ci.nsIWebNavigation); - sessionHistory.PurgeHistory(sessionHistory.count); + sessionHistory.legacySHistory.PurgeHistory(sessionHistory.count); }); // Once this windowClosed Promise resolves, we should have finished diff --git a/browser/components/sessionstore/test/browser_docshell_uuid_consistency.js b/browser/components/sessionstore/test/browser_docshell_uuid_consistency.js index 01e6b3a30dbc..1837805dacae 100644 --- a/browser/components/sessionstore/test/browser_docshell_uuid_consistency.js +++ b/browser/components/sessionstore/test/browser_docshell_uuid_consistency.js @@ -8,7 +8,7 @@ add_task(async function duplicateTab() { let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIDocShell); - let shEntry = docshell.sessionHistory.getEntryAtIndex(0, false); + let shEntry = docshell.sessionHistory.legacySHistory.getEntryAtIndex(0, false); is(shEntry.docshellID.toString(), docshell.historyID.toString()); }); @@ -19,7 +19,7 @@ add_task(async function duplicateTab() { let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIDocShell); - let shEntry = docshell.sessionHistory.getEntryAtIndex(0, false); + let shEntry = docshell.sessionHistory.legacySHistory.getEntryAtIndex(0, false); is(shEntry.docshellID.toString(), docshell.historyID.toString()); }); @@ -39,7 +39,7 @@ add_task(async function contentToChromeNavigate() { .QueryInterface(Ci.nsIDocShell); let sh = docshell.sessionHistory; is(sh.count, 1); - is(sh.getEntryAtIndex(0, false).docshellID.toString(), docshell.historyID.toString()); + is(sh.legacySHistory.getEntryAtIndex(0, false).docshellID.toString(), docshell.historyID.toString()); }); // Force the browser to navigate to the chrome process. @@ -58,8 +58,8 @@ add_task(async function contentToChromeNavigate() { let sh = docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory; is(sh.count, 2); - is(sh.getEntryAtIndex(0, false).docshellID.toString(), docShell.historyID.toString()); - is(sh.getEntryAtIndex(1, false).docshellID.toString(), docShell.historyID.toString()); + is(sh.legacySHistory.getEntryAtIndex(0, false).docshellID.toString(), docShell.historyID.toString()); + is(sh.legacySHistory.getEntryAtIndex(1, false).docshellID.toString(), docShell.historyID.toString()); BrowserTestUtils.removeTab(tab); }); diff --git a/browser/components/sessionstore/test/browser_purge_shistory.js b/browser/components/sessionstore/test/browser_purge_shistory.js index 09744e67ad6e..2b091d890029 100644 --- a/browser/components/sessionstore/test/browser_purge_shistory.js +++ b/browser/components/sessionstore/test/browser_purge_shistory.js @@ -15,7 +15,7 @@ const TAB_STATE = { function checkTabContents(browser) { return ContentTask.spawn(browser, null, async function() { let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation); - let history = webNavigation.sessionHistory.QueryInterface(Ci.nsISHistoryInternal); + let history = webNavigation.sessionHistory; Assert.ok(history && history.count == 1 && content.document.documentURI == "about:mozilla", "expected tab contents found"); }); diff --git a/browser/components/sessionstore/test/browser_replace_load.js b/browser/components/sessionstore/test/browser_replace_load.js index 63d30ff15232..7fe87a89fd1f 100644 --- a/browser/components/sessionstore/test/browser_replace_load.js +++ b/browser/components/sessionstore/test/browser_replace_load.js @@ -42,7 +42,7 @@ var testSwitchToTab = async function(url, options) { // Check that we didn't lose any history entries. await ContentTask.spawn(browser, null, async function() { let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation); - let history = webNavigation.sessionHistory.QueryInterface(Ci.nsISHistoryInternal); + let history = webNavigation.sessionHistory; Assert.equal(history && history.count, 3, "three history entries"); }); diff --git a/browser/components/sessionstore/test/browser_switch_remoteness.js b/browser/components/sessionstore/test/browser_switch_remoteness.js index e83801044f26..9e45c2e8721b 100644 --- a/browser/components/sessionstore/test/browser_switch_remoteness.js +++ b/browser/components/sessionstore/test/browser_switch_remoteness.js @@ -5,7 +5,7 @@ const URL = "http://example.com/browser_switch_remoteness_"; function countHistoryEntries(browser, expected) { return ContentTask.spawn(browser, { expected }, async function(args) { let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation); - let history = webNavigation.sessionHistory.QueryInterface(Ci.nsISHistoryInternal); + let history = webNavigation.sessionHistory; Assert.equal(history && history.count, args.expected, "correct number of shistory entries"); }); diff --git a/browser/components/sessionstore/test/content.js b/browser/components/sessionstore/test/content.js index 9fd1cc42cb29..3897b807c695 100644 --- a/browser/components/sessionstore/test/content.js +++ b/browser/components/sessionstore/test/content.js @@ -54,7 +54,7 @@ var historyListener = { var {sessionHistory} = docShell.QueryInterface(Ci.nsIWebNavigation); if (sessionHistory) { - sessionHistory.addSHistoryListener(historyListener); + sessionHistory.legacySHistory.addSHistoryListener(historyListener); } /** diff --git a/docshell/test/browser/browser_bug422543.js b/docshell/test/browser/browser_bug422543.js index 0fcabe99429c..d78851284cac 100644 --- a/docshell/test/browser/browser_bug422543.js +++ b/docshell/test/browser/browser_bug422543.js @@ -14,11 +14,11 @@ add_task(async function runTests() { ok(browser.canGoBack, "we can go back"); await whenPageShown(browser, () => browser.goBack()); - await checkListeners("goback", "back to the first shentry"); + await checkListeners("gotoindex", "back to the first shentry"); ok(browser.canGoForward, "we can go forward"); await whenPageShown(browser, () => browser.goForward()); - await checkListeners("goforward", "forward to the second shentry"); + await checkListeners("gotoindex", "forward to the second shentry"); await whenPageShown(browser, () => browser.reload()); await checkListeners("reload", "current shentry reloaded"); diff --git a/docshell/test/browser/browser_bug655273.js b/docshell/test/browser/browser_bug655273.js index ab26cc22b7d6..ec26b7e4e0f8 100644 --- a/docshell/test/browser/browser_bug655273.js +++ b/docshell/test/browser/browser_bug655273.js @@ -23,7 +23,7 @@ add_task(async function test() { .getInterface(Ci.nsIWebNavigation) .sessionHistory; - is(shistory.getEntryAtIndex(shistory.index, false).title, + is(shistory.legacySHistory.getEntryAtIndex(shistory.index, false).title, oldTitle, 'SHEntry title after pushstate.'); }); }); diff --git a/docshell/test/browser/browser_bug670318.js b/docshell/test/browser/browser_bug670318.js index 39beddfb8a03..ccec831b2884 100644 --- a/docshell/test/browser/browser_bug670318.js +++ b/docshell/test/browser/browser_bug670318.js @@ -30,7 +30,7 @@ add_task(async function test() { testDone.resolve(); }, true); - history.removeSHistoryListener(listener); + history.legacySHistory.removeSHistoryListener(listener); delete content._testListener; content.setTimeout(() => { content.location.reload(); }, 0); } @@ -55,7 +55,7 @@ add_task(async function test() { Ci.nsISupportsWeakReference]) }; - history.addSHistoryListener(listener); + history.legacySHistory.addSHistoryListener(listener); // Since listener implements nsISupportsWeakReference, we are // responsible for keeping it alive so that the GC doesn't clear // it before the test completes. We do this by anchoring the listener diff --git a/docshell/test/browser/file_bug422543_script.js b/docshell/test/browser/file_bug422543_script.js index bf92096650ec..58111f7dfe01 100644 --- a/docshell/test/browser/file_bug422543_script.js +++ b/docshell/test/browser/file_bug422543_script.js @@ -50,13 +50,13 @@ let testAPI = { init() { this.shistory = docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory; for (let listener of this.listeners) { - this.shistory.addSHistoryListener(listener); + this.shistory.legacySHistory.addSHistoryListener(listener); } }, cleanup() { for (let listener of this.listeners) { - this.shistory.removeSHistoryListener(listener); + this.shistory.legacySHistory.removeSHistoryListener(listener); } this.shistory = null; sendAsyncMessage("bug422543:cleanup:return", {}); @@ -76,7 +76,7 @@ let testAPI = { }, notifyReload() { - let internal = this.shistory.QueryInterface(Ci.nsISHistoryInternal); + let internal = this.shistory.legacySHistory.QueryInterface(Ci.nsISHistoryInternal); let rval = internal.notifyOnHistoryReload(content.document.documentURIObject, 0); sendAsyncMessage("bug422543:notifyReload:return", { rval }); diff --git a/docshell/test/chrome/bug112564_window.xul b/docshell/test/chrome/bug112564_window.xul index 0660408a4323..f0a56713d1e2 100644 --- a/docshell/test/chrome/bug112564_window.xul +++ b/docshell/test/chrome/bug112564_window.xul @@ -35,7 +35,7 @@ // Work around bug 467960 var history = gBrowser.webNavigation.sessionHistory; - history.PurgeHistory(history.count); + history.legacySHistory.PurgeHistory(history.count); window.close(); window.opener.wrappedJSObject.SimpleTest.finish(); diff --git a/docshell/test/chrome/bug215405_window.xul b/docshell/test/chrome/bug215405_window.xul index 9badd5eba5db..ab8445563d2b 100644 --- a/docshell/test/chrome/bug215405_window.xul +++ b/docshell/test/chrome/bug215405_window.xul @@ -34,7 +34,7 @@ gBrowser.removeEventListener("pageshow", eventListener, true); // Work around bug 467960 var history = gBrowser.webNavigation.sessionHistory; - history.PurgeHistory(history.count); + history.legacySHistory.PurgeHistory(history.count); window.close(); window.opener.wrappedJSObject.SimpleTest.finish(); diff --git a/docshell/test/chrome/bug396519_window.xul b/docshell/test/chrome/bug396519_window.xul index 1e10eeceee47..4e0d3ecff73a 100644 --- a/docshell/test/chrome/bug396519_window.xul +++ b/docshell/test/chrome/bug396519_window.xul @@ -59,7 +59,7 @@ var history = gBrowser.webNavigation.sessionHistory; if (history.count == gExpected.length) { for (var i=0; i= fromIndex; i--) { let entry = hist.getEntryAtIndex(i, false); let item = { @@ -3718,7 +3718,7 @@ Tab.prototype = { this.filter = Cc["@mozilla.org/appshell/component/browser-status-filter;1"].createInstance(Ci.nsIWebProgress); this.filter.addProgressListener(this, flags) this.browser.addProgressListener(this.filter, flags); - this.browser.sessionHistory.addSHistoryListener(this); + this.browser.sessionHistory.legacySHistory.addSHistoryListener(this); this.browser.addEventListener("DOMContentLoaded", this, true); this.browser.addEventListener("DOMFormHasPassword", this, true); @@ -3842,7 +3842,7 @@ Tab.prototype = { this.browser.removeProgressListener(this.filter); this.filter.removeProgressListener(this); this.filter = null; - this.browser.sessionHistory.removeSHistoryListener(this); + this.browser.sessionHistory.legacySHistory.removeSHistoryListener(this); this.browser.removeEventListener("DOMContentLoaded", this, true); this.browser.removeEventListener("DOMFormHasPassword", this, true); diff --git a/testing/firefox-ui/tests/puppeteer/test_toolbars.py b/testing/firefox-ui/tests/puppeteer/test_toolbars.py index 8ee6e23e8217..e4c935da0dce 100644 --- a/testing/firefox-ui/tests/puppeteer/test_toolbars.py +++ b/testing/firefox-ui/tests/puppeteer/test_toolbars.py @@ -22,7 +22,7 @@ class TestNavBar(PuppeteerMixin, MarionetteTestCase): # TODO: check why self.puppeteer.places.remove_all_history() does not work here self.marionette.execute_script(""" let count = gBrowser.sessionHistory.count; - gBrowser.sessionHistory.PurgeHistory(count); + gBrowser.sessionHistory.legacySHistory.PurgeHistory(count); """) def test_elements(self): diff --git a/toolkit/components/reader/ReaderMode.jsm b/toolkit/components/reader/ReaderMode.jsm index b2ba9e303813..6d39db34e1a3 100644 --- a/toolkit/components/reader/ReaderMode.jsm +++ b/toolkit/components/reader/ReaderMode.jsm @@ -102,7 +102,7 @@ var ReaderMode = { let webNav = docShell.QueryInterface(Ci.nsIWebNavigation); let sh = webNav.sessionHistory; if (webNav.canGoForward) { - let forwardEntry = sh.getEntryAtIndex(sh.index + 1, false); + let forwardEntry = sh.legacySHistory.getEntryAtIndex(sh.index + 1, false); let forwardURL = forwardEntry.URI.spec; if (forwardURL && (forwardURL == readerURL || !readerURL)) { webNav.goForward(); @@ -123,7 +123,7 @@ var ReaderMode = { let webNav = docShell.QueryInterface(Ci.nsIWebNavigation); let sh = webNav.sessionHistory; if (webNav.canGoBack) { - let prevEntry = sh.getEntryAtIndex(sh.index - 1, false); + let prevEntry = sh.legacySHistory.getEntryAtIndex(sh.index - 1, false); let prevURL = prevEntry.URI.spec; if (prevURL && (prevURL == originalURL || !originalURL)) { webNav.goBack(); diff --git a/toolkit/components/viewsource/content/viewSource-content.js b/toolkit/components/viewsource/content/viewSource-content.js index d623db35fb22..e0fb3bd460a1 100644 --- a/toolkit/components/viewsource/content/viewSource-content.js +++ b/toolkit/components/viewsource/content/viewSource-content.js @@ -270,6 +270,7 @@ var ViewSourceContent = { shEntry.cacheKey = shEntrySource.cacheKey; docShell.QueryInterface(Ci.nsIWebNavigation) .sessionHistory + .legacySHistory .QueryInterface(Ci.nsISHistoryInternal) .addEntry(shEntry, true); }, diff --git a/toolkit/content/browser-content.js b/toolkit/content/browser-content.js index 5071c0e8f066..b67b54a9194a 100644 --- a/toolkit/content/browser-content.js +++ b/toolkit/content/browser-content.js @@ -1277,10 +1277,11 @@ addMessageListener("Browser:PurgeSessionHistory", function BrowserPurgeHistory() // place the entry at current index at the end of the history list, so it won't get removed if (sessionHistory.index < sessionHistory.count - 1) { - let indexEntry = sessionHistory.getEntryAtIndex(sessionHistory.index, false); - sessionHistory.QueryInterface(Ci.nsISHistoryInternal); + let legacy = sessionHistory.legacySHistory; + legacy.QueryInterface(Ci.nsISHistoryInternal); + let indexEntry = legacy.getEntryAtIndex(sessionHistory.index, false); indexEntry.QueryInterface(Ci.nsISHEntry); - sessionHistory.addEntry(indexEntry, true); + legacy.addEntry(indexEntry, true); } let purge = sessionHistory.count; @@ -1289,7 +1290,7 @@ addMessageListener("Browser:PurgeSessionHistory", function BrowserPurgeHistory() } if (purge > 0) { - sessionHistory.PurgeHistory(purge); + sessionHistory.legacySHistory.PurgeHistory(purge); } }); diff --git a/toolkit/modules/E10SUtils.jsm b/toolkit/modules/E10SUtils.jsm index e1b61c0741a8..5b0763a8e04c 100644 --- a/toolkit/modules/E10SUtils.jsm +++ b/toolkit/modules/E10SUtils.jsm @@ -224,9 +224,9 @@ var E10SUtils = { // Allow history load if loaded in this process before. let webNav = aDocShell.QueryInterface(Ci.nsIWebNavigation); let sessionHistory = webNav.sessionHistory; - let requestedIndex = sessionHistory.requestedIndex; + let requestedIndex = sessionHistory.legacySHistory.requestedIndex; if (requestedIndex >= 0) { - if (sessionHistory.getEntryAtIndex(requestedIndex, false).loadedInThisProcess) { + if (sessionHistory.legacySHistory.getEntryAtIndex(requestedIndex, false).loadedInThisProcess) { return true; } @@ -265,7 +265,7 @@ var E10SUtils = { : null, reloadInFreshProcess: !!aFreshProcess, }, - historyIndex: sessionHistory.requestedIndex, + historyIndex: sessionHistory.legacySHistory.requestedIndex, }); return false; }, diff --git a/toolkit/modules/sessionstore/SessionHistory.jsm b/toolkit/modules/sessionstore/SessionHistory.jsm index 3aa3d21f7a30..3d754ec715f5 100644 --- a/toolkit/modules/sessionstore/SessionHistory.jsm +++ b/toolkit/modules/sessionstore/SessionHistory.jsm @@ -72,7 +72,7 @@ var SessionHistoryInternal = { collect(docShell, aFromIdx = -1) { let loadContext = docShell.QueryInterface(Ci.nsILoadContext); let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation); - let history = webNavigation.sessionHistory.QueryInterface(Ci.nsISHistoryInternal); + let history = webNavigation.sessionHistory; let data = {entries: [], userContextId: loadContext.originAttributes.userContextId }; // We want to keep track how many entries we *could* have collected and @@ -83,7 +83,8 @@ var SessionHistoryInternal = { if (history && history.count > 0) { // Loop over the transaction linked list directly so we can get the // persist property for each transaction. - for (let txn = history.rootTransaction; txn; entryCount++, txn = txn.next) { + for (let txn = history.legacySHistory.QueryInterface(Ci.nsISHistoryInternal).rootTransaction; + txn; entryCount++, txn = txn.next) { if (entryCount <= aFromIdx) { skippedCount++; continue; @@ -317,7 +318,7 @@ var SessionHistoryInternal = { */ restore(docShell, tabData) { let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation); - let history = webNavigation.sessionHistory; + let history = webNavigation.sessionHistory.legacySHistory; if (history.count > 0) { history.PurgeHistory(history.count); }