mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[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:
parent
15e832da8a
commit
11e159fd31
1 changed files with 4 additions and 4 deletions
|
|
@ -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 = {});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue