mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Fix regression in categorizing highly generic filters at load time
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3235#issuecomment-2790807915
Regression from:
8b696a691a
This commit is contained in:
parent
0fdcd44794
commit
9029d1d715
1 changed files with 10 additions and 7 deletions
|
|
@ -474,18 +474,21 @@ CosmeticFilteringEngine.prototype.fromCompiledContent = function(reader, options
|
|||
// Handle specific filters meant to apply everywhere, i.e. selectors
|
||||
// not to be injected conditionally through the DOM surveyor.
|
||||
// hash, *, .promoted-tweet
|
||||
case 8:
|
||||
if ( args[1] === '*' ) {
|
||||
case 8: {
|
||||
if ( args[1] === '*' && args[2].charCodeAt(0) === 0x2D /* + */ ) {
|
||||
const selector = args[2].slice(1);
|
||||
if ( this.reSimpleHighGeneric.test(selector) )
|
||||
this.highlyGeneric.simple.dict.add(selector);
|
||||
else {
|
||||
this.highlyGeneric.complex.dict.add(selector);
|
||||
if ( selector.charCodeAt(0) !== 0x7B /* { */ ) {
|
||||
if ( this.reSimpleHighGeneric.test(selector) ) {
|
||||
this.highlyGeneric.simple.dict.add(selector);
|
||||
} else {
|
||||
this.highlyGeneric.complex.dict.add(selector);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.specificFilters.store(args[1], args[2]);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
this.discardedCount += 1;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue