mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Force cache bypass reload when no-scripting switch is toggled
Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/3652
This commit is contained in:
parent
fad39c6ce5
commit
4affe343dd
1 changed files with 7 additions and 1 deletions
|
|
@ -56,6 +56,7 @@ let dfPaneBuilt = false;
|
|||
let dfHotspots = null;
|
||||
const allHostnameRows = [];
|
||||
let cachedPopupHash = '';
|
||||
let forceReloadFlag = 0;
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/2550
|
||||
// Solution inspired from
|
||||
|
|
@ -130,6 +131,7 @@ const hashFromPopupData = function(reset = false) {
|
|||
const hash = hasher.join('');
|
||||
if ( reset ) {
|
||||
cachedPopupHash = hash;
|
||||
forceReloadFlag = 0;
|
||||
}
|
||||
dom.cl.toggle(dom.body, 'needReload',
|
||||
hash !== cachedPopupHash || popupData.hasUnprocessedRequest === true
|
||||
|
|
@ -1167,7 +1169,7 @@ const reloadTab = function(bypassCache = false) {
|
|||
tabId: popupData.tabId,
|
||||
url: popupData.rawURL,
|
||||
select: vAPI.webextFlavor.soup.has('mobile'),
|
||||
bypassCache,
|
||||
bypassCache: bypassCache || forceReloadFlag !== 0,
|
||||
});
|
||||
|
||||
// Polling will take care of refreshing the popup content
|
||||
|
|
@ -1344,6 +1346,10 @@ const toggleHostnameSwitch = async function(ev) {
|
|||
persist: ev.ctrlKey || ev.metaKey,
|
||||
});
|
||||
|
||||
if ( switchName === 'no-scripting' ) {
|
||||
forceReloadFlag ^= 1;
|
||||
}
|
||||
|
||||
cachePopupData(response);
|
||||
hashFromPopupData();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue