Add support for `!#if false` in list directive processor

To more easily comment out blocks of filters.
This commit is contained in:
Raymond Hill 2019-08-25 09:08:41 -04:00
parent e0fd9750d4
commit 1d805fb9da
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 5 additions and 2 deletions

View File

@ -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' ],
]); ]);
/******************************************************************************/ /******************************************************************************/