1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

Fix regression in the collapsing of blocked resources

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/356
This commit is contained in:
Raymond Hill 2018-12-27 10:17:08 -05:00
parent 0dde563759
commit eb1428c8bb
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -774,8 +774,6 @@ vAPI.domFilterer = new vAPI.DOMFilterer();
vAPI.domCollapser = (function() { vAPI.domCollapser = (function() {
const messaging = vAPI.messaging; const messaging = vAPI.messaging;
const toProcess = [];
const toFilter = [];
const toCollapse = new Map(); const toCollapse = new Map();
const src1stProps = { const src1stProps = {
embed: 'src', embed: 'src',
@ -798,6 +796,8 @@ vAPI.domCollapser = (function() {
cachedBlockedSet, cachedBlockedSet,
cachedBlockedSetHash, cachedBlockedSetHash,
cachedBlockedSetTimer, cachedBlockedSetTimer,
toProcess = [],
toFilter = [],
netSelectorCacheCount = 0; netSelectorCacheCount = 0;
const cachedBlockedSetClear = function() { const cachedBlockedSetClear = function() {
@ -888,8 +888,8 @@ vAPI.domCollapser = (function() {
hash: cachedBlockedSetHash hash: cachedBlockedSetHash
}; };
messaging.send('contentscript', msg, onProcessed); messaging.send('contentscript', msg, onProcessed);
toProcess.length = 0; toProcess = [];
toFilter.length = 0; toFilter = [];
resquestIdGenerator += 1; resquestIdGenerator += 1;
}; };
@ -949,10 +949,7 @@ vAPI.domCollapser = (function() {
return; return;
} }
if ( src.startsWith('http') === false ) { return; } if ( src.startsWith('http') === false ) { return; }
toFilter[toFilter.length] = { toFilter.push({ type: 'sub_frame', url: iframe.src });
type: 'sub_frame',
url: iframe.src
};
add(iframe); add(iframe);
}; };