From ebe173d273e93cf35c8c7cc861bed00169be8daa Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 6 Oct 2021 08:48:49 -0400 Subject: [PATCH] Add a test for negated type with `all` option Related feedback: - https://github.com/uBlockOrigin/uAssets/issues/7639#issuecomment-933525018 --- platform/npm/tests/snfe.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platform/npm/tests/snfe.js b/platform/npm/tests/snfe.js index eb5d2d4cc..c6de0aeac 100644 --- a/platform/npm/tests/snfe.js +++ b/platform/npm/tests/snfe.js @@ -287,6 +287,18 @@ describe('SNFE', () => { }); assert(engine.isBlockImportant()); }); + + it('should block all except stylesheets', async () => { + await engine.useLists([ + { name: 'test', raw: '||example.com^$~stylesheet,all' }, + ]); + const r = engine.matchRequest({ + originURL: 'https://www.example.com/', + type: 'stylesheet', + url: 'https://www.example.com/', + }); + assert.strictEqual(r, 0); + }); }); }); }