Skip to content

Commit

Permalink
Add support for !#if false in list directive processor
Browse files Browse the repository at this point in the history
To more easily comment out blocks of filters.
  • Loading branch information
gorhill committed Aug 25, 2019
1 parent e0fd975 commit 1d805fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/js/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,10 @@
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;
vAPI.webextFlavor.soup.has(token) === target;
if ( discard === false && startDiscard ) {
parts.push(content.slice(beg, match.index));
discard = true;
Expand Down Expand Up @@ -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' ],
]);

/******************************************************************************/
Expand Down

0 comments on commit 1d805fb

Please sign in to comment.