[mv3] Discard regex- or path-based targets in static extended filters

There is no support yet for such filters in uBO Lite.
This commit is contained in:
Raymond Hill 2025-04-11 09:49:03 -04:00
parent 15e832da8a
commit 11e159fd31
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -31,7 +31,7 @@ import staticNetFilteringEngine from './static-net-filtering.js';
/******************************************************************************/
const isRegex = hn => hn.startsWith('/') && hn.endsWith('/');
const isRegexOrPath = hn => hn.includes('/');
/******************************************************************************/
@ -112,7 +112,7 @@ function addExtendedToDNR(context, parser) {
for ( const { hn, not, bad } of parser.getExtFilterDomainIterator() ) {
if ( bad ) { continue; }
if ( exception ) { continue; }
if ( isRegex(hn) ) { continue; }
if ( isRegexOrPath(hn) ) { continue; }
let details = context.scriptletFilters.get(argsToken);
if ( details === undefined ) {
context.scriptletFilters.set(argsToken, details = { args });
@ -170,7 +170,7 @@ function addExtendedToDNR(context, parser) {
};
for ( const { hn, not, bad } of parser.getExtFilterDomainIterator() ) {
if ( bad ) { continue; }
if ( isRegex(hn) ) { continue; }
if ( isRegexOrPath(hn) ) { continue; }
if ( not ) {
if ( rule.condition.excludedInitiatorDomains === undefined ) {
rule.condition.excludedInitiatorDomains = [];
@ -225,7 +225,7 @@ function addExtendedToDNR(context, parser) {
for ( const { hn, not, bad } of parser.getExtFilterDomainIterator() ) {
if ( bad ) { continue; }
if ( not && exception ) { continue; }
if ( isRegex(hn) ) { continue; }
if ( isRegexOrPath(hn) ) { continue; }
if ( details === undefined ) {
context.specificCosmeticFilters.set(compiled, details = {});
}