Skip to content

Commit 4affe34

Browse files
committed
Force cache bypass reload when no-scripting switch is toggled
Related issue: uBlockOrigin/uBlock-issues#3652
1 parent fad39c6 commit 4affe34

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/js/popup-fenix.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ let dfPaneBuilt = false;
5656
let dfHotspots = null;
5757
const allHostnameRows = [];
5858
let cachedPopupHash = '';
59+
let forceReloadFlag = 0;
5960

6061
// https://github.com/gorhill/uBlock/issues/2550
6162
// Solution inspired from
@@ -130,6 +131,7 @@ const hashFromPopupData = function(reset = false) {
130131
const hash = hasher.join('');
131132
if ( reset ) {
132133
cachedPopupHash = hash;
134+
forceReloadFlag = 0;
133135
}
134136
dom.cl.toggle(dom.body, 'needReload',
135137
hash !== cachedPopupHash || popupData.hasUnprocessedRequest === true
@@ -1167,7 +1169,7 @@ const reloadTab = function(bypassCache = false) {
11671169
tabId: popupData.tabId,
11681170
url: popupData.rawURL,
11691171
select: vAPI.webextFlavor.soup.has('mobile'),
1170-
bypassCache,
1172+
bypassCache: bypassCache || forceReloadFlag !== 0,
11711173
});
11721174

11731175
// Polling will take care of refreshing the popup content
@@ -1344,6 +1346,10 @@ const toggleHostnameSwitch = async function(ev) {
13441346
persist: ev.ctrlKey || ev.metaKey,
13451347
});
13461348

1349+
if ( switchName === 'no-scripting' ) {
1350+
forceReloadFlag ^= 1;
1351+
}
1352+
13471353
cachePopupData(response);
13481354
hashFromPopupData();
13491355

0 commit comments

Comments
 (0)