From a9a5d996767abf7cebe35bc62420eca98cb156ea Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 27 Jun 2021 20:42:39 +0200 Subject: [PATCH] Do not add network filters in adblocker cache to fix session enhancing --- plugins/adblocker/blocker.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/adblocker/blocker.js b/plugins/adblocker/blocker.js index 81d6ec5f..e62b1919 100644 --- a/plugins/adblocker/blocker.js +++ b/plugins/adblocker/blocker.js @@ -33,7 +33,17 @@ const loadAdBlockerEngine = ( ...additionalBlockLists, ]; - ElectronBlocker.fromLists(fetch, lists, {}, cachingOptions) + ElectronBlocker.fromLists( + fetch, + lists, + { + // when generating the engine for caching, do not load network filters + // So that enhancing the session works as expected + // Allowing to define multiple webRequest listeners + loadNetworkFilters: session !== undefined, + }, + cachingOptions + ) .then((blocker) => { if (session) { blocker.enableBlockingInSession(session);