From aafecbaa95c1584db7b1236b91caee69df2449c1 Mon Sep 17 00:00:00 2001 From: Pale Moon Date: Sun, 12 Apr 2020 14:50:40 +0200 Subject: [PATCH] [Pale-Moon] Issue #1772 - Only refresh tabs in restore-on-demand mode. Only enable the refresh modes for session store cache behavior if the currently selected mode is "Don't restore tabs until selected" to prevent known issues with restoring too many tabs from the network concurrently. This resolves #1772 --- .../components/sessionstore/SessionStore.jsm | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/application/palemoon/components/sessionstore/SessionStore.jsm b/application/palemoon/components/sessionstore/SessionStore.jsm index dae7789f75..23fdac3f81 100644 --- a/application/palemoon/components/sessionstore/SessionStore.jsm +++ b/application/palemoon/components/sessionstore/SessionStore.jsm @@ -3236,19 +3236,24 @@ var SessionStoreInternal = { // instead of gotoIndex. See bug 597315. browser.webNavigation.sessionHistory.getEntryAtIndex(activeIndex, true); browser.webNavigation.sessionHistory.reloadCurrentEntry(); - // If the user prefers it, bypass cache and always load from the network. - let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE; - switch (this._cacheBehavior) { - case 2: // hard refresh - flags = Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY | - Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE; - browser.webNavigation.reload(flags); - break; - case 1: // soft refresh - browser.webNavigation.reload(flags); - break; - default: // 0 or other: use cache, so do nothing. - break; + // If the user prefers it, bypass cache and always load from the network, + // but only if restoring on demand, to prevent request flooding (since + // reloading will override the max tabs to restore concurrently mechanism). + // See Issue #1772 + if (restoreOnDemand) { + let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE; + switch (this._cacheBehavior) { + case 2: // hard refresh + flags = Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY | + Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE; + browser.webNavigation.reload(flags); + break; + case 1: // soft refresh + browser.webNavigation.reload(flags); + break; + default: // 0 or other: use cache, so do nothing. + break; + } } } catch (ex) {