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,6 +957,8 @@
if ( target ) { expr = expr.slice(1); }
const token = this.processDirectives.tokens.get(expr);
const startDiscard =
token === 'false' &&
target === false ||
token !== undefined &&
vAPI.webextFlavor.soup.has(token) === target;
if ( discard === false && startDiscard ) {
@ -995,7 +997,8 @@
[ 'env_mobile', 'mobile' ],
[ 'env_safari', 'safari' ],
[ 'cap_html_filtering', 'html_filtering' ],
[ 'cap_user_stylesheet', 'user_stylesheet' ]
[ 'cap_user_stylesheet', 'user_stylesheet' ],
[ 'false', 'false' ],
]);
/******************************************************************************/