diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /browser/components/sessionstore/test/head.js | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/sessionstore/test/head.js')
-rw-r--r-- | browser/components/sessionstore/test/head.js | 49 |
1 files changed, 9 insertions, 40 deletions
diff --git a/browser/components/sessionstore/test/head.js b/browser/components/sessionstore/test/head.js index d475fa86a1..85db6e9d5e 100644 --- a/browser/components/sessionstore/test/head.js +++ b/browser/components/sessionstore/test/head.js @@ -144,7 +144,7 @@ function waitForTopic(aTopic, aTimeout, aCallback) { aCallback(false); }, aTimeout); - function observer(subject, topic, data) { + function observer() { removeObserver(); timeout = clearTimeout(timeout); executeSoon(() => aCallback(true)); @@ -268,7 +268,7 @@ var gWebProgressListener = { } }, - onStateChange(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) { + onStateChange(aBrowser, aWebProgress, aRequest, aStateFlags, _aStatus) { if ( aStateFlags & Ci.nsIWebProgressListener.STATE_STOP && aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK && @@ -298,7 +298,7 @@ var gProgressListener = { } }, - observe(browser, topic, data) { + observe(browser) { gProgressListener.onRestored(browser); }, @@ -451,7 +451,7 @@ function modifySessionStorage(browser, storageData, storageOptions = {}) { return SpecialPowers.spawn( browsingContext, [[storageData, storageOptions]], - async function ([data, options]) { + async function ([data]) { let frame = content; let keys = new Set(Object.keys(data)); let isClearing = !keys.size; @@ -558,35 +558,9 @@ function setPropertyOfFormField(browserContext, selector, propName, newValue) { } function promiseOnHistoryReplaceEntry(browser) { - if (SpecialPowers.Services.appinfo.sessionHistoryInParent) { - return new Promise(resolve => { - let sessionHistory = browser.browsingContext?.sessionHistory; - if (sessionHistory) { - var historyListener = { - OnHistoryNewEntry() {}, - OnHistoryGotoIndex() {}, - OnHistoryPurge() {}, - OnHistoryReload() { - return true; - }, - - OnHistoryReplaceEntry() { - resolve(); - }, - - QueryInterface: ChromeUtils.generateQI([ - "nsISHistoryListener", - "nsISupportsWeakReference", - ]), - }; - - sessionHistory.addSHistoryListener(historyListener); - } - }); - } - - return SpecialPowers.spawn(browser, [], () => { - return new Promise(resolve => { + return new Promise(resolve => { + let sessionHistory = browser.browsingContext?.sessionHistory; + if (sessionHistory) { var historyListener = { OnHistoryNewEntry() {}, OnHistoryGotoIndex() {}, @@ -605,13 +579,8 @@ function promiseOnHistoryReplaceEntry(browser) { ]), }; - var { sessionHistory } = this.docShell.QueryInterface( - Ci.nsIWebNavigation - ); - if (sessionHistory) { - sessionHistory.legacySHistory.addSHistoryListener(historyListener); - } - }); + sessionHistory.addSHistoryListener(historyListener); + } }); } |