mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] Determine "genericity" on a per-cosmetic filter basis
Related issue: https://github.com/uBlockOrigin/uBOL-home/issues/328
This commit is contained in:
parent
12c8bc6c5b
commit
f51a4c79db
1 changed files with 3 additions and 2 deletions
|
|
@ -222,6 +222,7 @@ function addExtendedToDNR(context, parser) {
|
|||
return;
|
||||
}
|
||||
let details = context.specificCosmeticFilters.get(compiled);
|
||||
let isGeneric = true;
|
||||
for ( const { hn, not, bad } of parser.getExtFilterDomainIterator() ) {
|
||||
if ( bad ) { continue; }
|
||||
if ( not && exception ) { continue; }
|
||||
|
|
@ -247,14 +248,14 @@ function addExtendedToDNR(context, parser) {
|
|||
details.matches = [ '*' ];
|
||||
continue;
|
||||
}
|
||||
isGeneric = false;
|
||||
details.matches.push(hn);
|
||||
}
|
||||
if ( details === undefined ) { return; }
|
||||
if ( exception ) { return; }
|
||||
if ( compiled.startsWith('{') ) { return; }
|
||||
if ( details.matches === undefined || details.matches.includes('*') ) {
|
||||
if ( isGeneric ) {
|
||||
addGenericCosmeticFilter(context, compiled, false);
|
||||
details.matches = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue