[Mypal] Only refresh tabs in restore-on-demand mode.

master
Fedor 2020-08-12 10:13:09 +03:00
parent f21d318a5b
commit b0d7f0b89b
1 changed files with 18 additions and 13 deletions

View File

@ -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 (TabRestoreQueue.prefs.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) {