A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/gorhill/uBlock/commit/33b409dd5baee1fd48a02bac757dc599373f1aa5 below:

Add support for AdGuard's noop (`_`) network filter option · gorhill/uBlock@33b409d · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+11

-2

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+11

-2

lines changed Original file line number Diff line number Diff line change

@@ -798,6 +798,7 @@ export class AstFilterParser {

798 798

this.reUnescapeCommas = /((?:^|[^\\])(?:\\\\)*)\\,/g;

799 799

this.reUnescapeSingleQuotes = /((?:^|[^\\])(?:\\\\)*)\\'/g;

800 800

this.reUnescapeDoubleQuotes = /((?:^|[^\\])(?:\\\\)*)\\"/g;

801 +

this.reNoopOption = /^_+$/;

801 802

}

802 803 803 804

parse(raw) {

@@ -1854,13 +1855,21 @@ export class AstFilterParser {

1854 1855

const equalPos = s.indexOf('=');

1855 1856

const nameEnd = equalPos !== -1 ? equalPos : s.length;

1856 1857

const name = s.slice(nameBeg, nameEnd);

1857 -

const nodeOptionType = nodeTypeFromOptionName.get(name) || NODE_TYPE_NET_OPTION_NAME_UNKNOWN;

1858 +

let nodeOptionType = nodeTypeFromOptionName.get(name);

1859 +

if ( nodeOptionType === undefined ) {

1860 +

nodeOptionType = this.reNoopOption.test(name)

1861 +

? NODE_TYPE_NET_OPTION_NAME_NOOP

1862 +

: NODE_TYPE_NET_OPTION_NAME_UNKNOWN;

1863 +

}

1858 1864

next = this.allocTypedNode(

1859 1865

nodeOptionType,

1860 1866

parentBeg + nameBeg,

1861 1867

parentBeg + nameEnd

1862 1868

);

1863 -

if ( this.getBranchFromType(nodeOptionType) !== 0 ) {

1869 +

if (

1870 +

nodeOptionType !== NODE_TYPE_NET_OPTION_NAME_NOOP &&

1871 +

this.getBranchFromType(nodeOptionType) !== 0

1872 +

) {

1864 1873

this.addNodeFlags(parent, NODE_FLAG_ERROR);

1865 1874

this.addFlags(AST_FLAG_HAS_ERROR);

1866 1875

this.astError = AST_ERROR_OPTION_DUPLICATE;

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4