Skip to content

Commit

Permalink
Fix regression in the collapsing of blocked resources
Browse files Browse the repository at this point in the history
Related issue:
- uBlockOrigin/uBlock-issues#356

Co-authored-by:  gorhill <[email protected]>
  • Loading branch information
hawkeye116477 and gorhill committed Jun 29, 2020
1 parent 5bac0b9 commit d7213bb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/js/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,6 @@ vAPI.domFilterer = new vAPI.DOMFilterer();

vAPI.domCollapser = (function() {
const messaging = vAPI.messaging;
const toProcess = [];
const toFilter = [];
const toCollapse = new Map();
const src1stProps = {
embed: 'src',
Expand All @@ -791,6 +789,8 @@ vAPI.domCollapser = (function() {
cachedBlockedSet,
cachedBlockedSetHash,
cachedBlockedSetTimer,
toProcess = [],
toFilter = [],
netSelectorCacheCount = 0;

const cachedBlockedSetClear = function() {
Expand Down Expand Up @@ -881,8 +881,8 @@ vAPI.domCollapser = (function() {
hash: cachedBlockedSetHash
};
messaging.send('contentscript', msg, onProcessed);
toProcess.length = 0;
toFilter.length = 0;
toProcess = [];
toFilter = [];
resquestIdGenerator += 1;
};

Expand Down Expand Up @@ -944,10 +944,7 @@ vAPI.domCollapser = (function() {
return;
}
if ( src.lastIndexOf('http', 0) !== 0 ) { return; }
toFilter[toFilter.length] = {
type: 'sub_frame',
url: iframe.src
};
toFilter.push({ type: 'sub_frame', url: iframe.src });
add(iframe);
};

Expand Down

0 comments on commit d7213bb

Please sign in to comment.