Fix look-up of specific-generic filters entity-less hostnames

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/688#issuecomment-743755956
This commit is contained in:
Raymond Hill 2020-12-14 11:22:08 -05:00
parent c45b93a25c
commit b22cf24bd5
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 12 additions and 12 deletions

View File

@ -368,12 +368,14 @@
hostname,
[ plains, exceptions, procedurals, exceptions ]
);
if ( details.entity !== '' ) {
filterDB.retrieve(
`${hostname.slice(0, -details.domain.length)}${details.entity}`,
[ plains, exceptions, procedurals, exceptions ]
);
}
const entity = details.entity !== ''
? `${hostname.slice(0, -details.domain.length)}${details.entity}`
: '*';
filterDB.retrieve(
entity,
[ plains, exceptions, procedurals, exceptions ],
1
);
if ( plains.size === 0 && procedurals.size === 0 ) { return; }

View File

@ -318,12 +318,10 @@
sessionScriptletDB.retrieve([ null, $exceptions ]);
}
scriptletDB.retrieve(hostname, [ $scriptlets, $exceptions ]);
if ( request.entity !== '' ) {
scriptletDB.retrieve(
`${hostname.slice(0, -request.domain.length)}${request.entity}`,
[ $scriptlets, $exceptions ]
);
}
const entity = request.entity !== ''
? `${hostname.slice(0, -request.domain.length)}${request.entity}`
: '*';
scriptletDB.retrieve(entity, [ $scriptlets, $exceptions ], 1);
if ( $scriptlets.size === 0 ) { return; }
const loggerEnabled = µb.logger.enabled;