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:
Raymond Hill 2025-04-09 18:23:01 -04:00
parent 0fdcd44794
commit 9029d1d715
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -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;