Skip to content

Commit 1d805fb

Browse files
committed
Add support for !#if false in list directive processor
To more easily comment out blocks of filters.
1 parent e0fd975 commit 1d805fb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/js/storage.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,8 +957,10 @@
957957
if ( target ) { expr = expr.slice(1); }
958958
const token = this.processDirectives.tokens.get(expr);
959959
const startDiscard =
960+
token === 'false' &&
961+
target === false ||
960962
token !== undefined &&
961-
vAPI.webextFlavor.soup.has(token) === target;
963+
vAPI.webextFlavor.soup.has(token) === target;
962964
if ( discard === false && startDiscard ) {
963965
parts.push(content.slice(beg, match.index));
964966
discard = true;
@@ -995,7 +997,8 @@
995997
[ 'env_mobile', 'mobile' ],
996998
[ 'env_safari', 'safari' ],
997999
[ 'cap_html_filtering', 'html_filtering' ],
998-
[ 'cap_user_stylesheet', 'user_stylesheet' ]
1000+
[ 'cap_user_stylesheet', 'user_stylesheet' ],
1001+
[ 'false', 'false' ],
9991002
]);
10001003

10011004
/******************************************************************************/

0 commit comments

Comments
 (0)