From 1d805fb9da1aad918d02cc74796d5aa5e974b184 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 25 Aug 2019 09:08:41 -0400 Subject: [PATCH] Add support for `!#if false` in list directive processor To more easily comment out blocks of filters. --- src/js/storage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/storage.js b/src/js/storage.js index 9c6eb49f9..2d1619b77 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -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; @@ -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' ], ]); /******************************************************************************/