New static network filter option `urlskip=` · gorhill/uBlock@266ec48

@@ -191,6 +191,7 @@ export const NODE_TYPE_NET_OPTION_NAME_REPLACE = iota++;

191191

export const NODE_TYPE_NET_OPTION_NAME_SCRIPT = iota++;

192192

export const NODE_TYPE_NET_OPTION_NAME_SHIDE = iota++;

193193

export const NODE_TYPE_NET_OPTION_NAME_TO = iota++;

194+

export const NODE_TYPE_NET_OPTION_NAME_URLSKIP = iota++;

194195

export const NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM = iota++;

195196

export const NODE_TYPE_NET_OPTION_NAME_XHR = iota++;

196197

export const NODE_TYPE_NET_OPTION_NAME_WEBRTC = iota++;

@@ -274,6 +275,7 @@ export const nodeTypeFromOptionName = new Map([

274275

[ 'shide', NODE_TYPE_NET_OPTION_NAME_SHIDE ],

275276

/* synonym */ [ 'specifichide', NODE_TYPE_NET_OPTION_NAME_SHIDE ],

276277

[ 'to', NODE_TYPE_NET_OPTION_NAME_TO ],

278+

[ 'urlskip', NODE_TYPE_NET_OPTION_NAME_URLSKIP ],

277279

[ 'uritransform', NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM ],

278280

[ 'xhr', NODE_TYPE_NET_OPTION_NAME_XHR ],

279281

/* synonym */ [ 'xmlhttprequest', NODE_TYPE_NET_OPTION_NAME_XHR ],

@@ -1441,6 +1443,7 @@ export class AstFilterParser {

14411443

case NODE_TYPE_NET_OPTION_NAME_REDIRECT:

14421444

case NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE:

14431445

case NODE_TYPE_NET_OPTION_NAME_REPLACE:

1446+

case NODE_TYPE_NET_OPTION_NAME_URLSKIP:

14441447

case NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM:

14451448

realBad = isNegated || (isException || hasValue) === false ||

14461449

modifierType !== 0;

@@ -1519,6 +1522,21 @@ export class AstFilterParser {

15191522

}

15201523

break;

15211524

}

1525+

case NODE_TYPE_NET_OPTION_NAME_URLSKIP: {

1526+

realBad = abstractTypeCount || behaviorTypeCount || unredirectableTypeCount;

1527+

if ( realBad ) { break; }

1528+

if ( requiresTrustedSource() ) {

1529+

this.astError = AST_ERROR_UNTRUSTED_SOURCE;

1530+

realBad = true;

1531+

break;

1532+

}

1533+

const value = this.getNetOptionValue(NODE_TYPE_NET_OPTION_NAME_URLSKIP);

1534+

if ( value.startsWith('?') === false || value.length < 2 ) {

1535+

this.astError = AST_ERROR_OPTION_BADVALUE;

1536+

realBad = true;

1537+

}

1538+

break;

1539+

}

15221540

case NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM: {

15231541

realBad = abstractTypeCount || behaviorTypeCount || unredirectableTypeCount;

15241542

if ( realBad ) { break; }

@@ -3139,6 +3157,7 @@ export const netOptionTokenDescriptors = new Map([

31393157

[ 'shide', { } ],

31403158

/* synonym */ [ 'specifichide', { } ],

31413159

[ 'to', { mustAssign: true } ],

3160+

[ 'urlskip', { mustAssign: true } ],

31423161

[ 'uritransform', { mustAssign: true } ],

31433162

[ 'xhr', { canNegate: true } ],

31443163

/* synonym */ [ 'xmlhttprequest', { canNegate: true } ],