mirror of https://github.com/gorhill/uBlock.git
code review
This commit is contained in:
parent
1136734e33
commit
09740463a7
|
@ -348,7 +348,7 @@ var messager = vAPI.messaging.channel('contentscript-end.js');
|
||||||
// requests to process high-high generics into as few requests as possible.
|
// requests to process high-high generics into as few requests as possible.
|
||||||
// The gain is *significant* on bloated pages.
|
// The gain is *significant* on bloated pages.
|
||||||
|
|
||||||
var processHighHighGenericsMisses = 0;
|
var processHighHighGenericsMisses = 8;
|
||||||
var processHighHighGenericsTimer = null;
|
var processHighHighGenericsTimer = null;
|
||||||
|
|
||||||
var processHighHighGenerics = function() {
|
var processHighHighGenerics = function() {
|
||||||
|
@ -359,12 +359,12 @@ var messager = vAPI.messaging.channel('contentscript-end.js');
|
||||||
//var tStart = timer.now();
|
//var tStart = timer.now();
|
||||||
if ( document.querySelector(highGenerics.hideHigh) === null ) {
|
if ( document.querySelector(highGenerics.hideHigh) === null ) {
|
||||||
//console.debug('%f: high-high generic test time', timer.now() - tStart);
|
//console.debug('%f: high-high generic test time', timer.now() - tStart);
|
||||||
processHighHighGenericsMisses += 1;
|
processHighHighGenericsMisses -= 1;
|
||||||
// Too many misses for these nagging highly generic CSS rules,
|
// Too many misses for these nagging highly generic CSS rules,
|
||||||
// so we will just skip them from now on.
|
// so we will just skip them from now on.
|
||||||
if ( processHighHighGenericsMisses >= 8 ) {
|
if ( processHighHighGenericsMisses === 0 ) {
|
||||||
injectedSelectors['{{highHighGenerics}}'] = true;
|
injectedSelectors['{{highHighGenerics}}'] = true;
|
||||||
console.debug('high-high generic: clearly not needed...');
|
console.debug('high-high generic: apparently not needed...');
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue