mirror of https://github.com/gorhill/uBlock.git
Add support for `!#if false` in list directive processor
To more easily comment out blocks of filters.
This commit is contained in:
parent
e0fd9750d4
commit
1d805fb9da
|
@ -957,8 +957,10 @@
|
||||||
if ( target ) { expr = expr.slice(1); }
|
if ( target ) { expr = expr.slice(1); }
|
||||||
const token = this.processDirectives.tokens.get(expr);
|
const token = this.processDirectives.tokens.get(expr);
|
||||||
const startDiscard =
|
const startDiscard =
|
||||||
|
token === 'false' &&
|
||||||
|
target === false ||
|
||||||
token !== undefined &&
|
token !== undefined &&
|
||||||
vAPI.webextFlavor.soup.has(token) === target;
|
vAPI.webextFlavor.soup.has(token) === target;
|
||||||
if ( discard === false && startDiscard ) {
|
if ( discard === false && startDiscard ) {
|
||||||
parts.push(content.slice(beg, match.index));
|
parts.push(content.slice(beg, match.index));
|
||||||
discard = true;
|
discard = true;
|
||||||
|
@ -995,7 +997,8 @@
|
||||||
[ 'env_mobile', 'mobile' ],
|
[ 'env_mobile', 'mobile' ],
|
||||||
[ 'env_safari', 'safari' ],
|
[ 'env_safari', 'safari' ],
|
||||||
[ 'cap_html_filtering', 'html_filtering' ],
|
[ 'cap_html_filtering', 'html_filtering' ],
|
||||||
[ 'cap_user_stylesheet', 'user_stylesheet' ]
|
[ 'cap_user_stylesheet', 'user_stylesheet' ],
|
||||||
|
[ 'false', 'false' ],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue