From 1a9a8aae0c8969dad9743e31dd465c8892b89f32 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 11 May 2023 11:46:31 -0400 Subject: [PATCH] Fix improperly unselecting imported lists Related feedback: - https://www.reddit.com/r/uBlockOrigin/comments/13enzvv/ When assessing which default lists to disable/enable after updating from 1.48.x to 1.49.x, uBO has to ignore imported lists, as these do not have a `off` property -- the non-existence of this property was used to determine whether a list was default or not. There needs to be an extra test for whether the list is imported or not. --- src/js/storage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/storage.js b/src/js/storage.js index 85388b377..f227bb2d1 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -1625,7 +1625,11 @@ self.addEventListener('hiddenSettingsChanged', ( ) => { if ( newDefaultListset.size === 0 ) { return; } if ( oldDefaultListset.size === 0 ) { Array.from(Object.entries(oldDict)) - .filter(a => a[1].content === 'filters' && a[1].off === undefined) + .filter(a => + a[1].content === 'filters' && + a[1].off === undefined && + /^https?:\/\//.test(a[0]) === false + ) .map(a => a[0]) .forEach(a => oldDefaultListset.add(a)); if ( oldDefaultListset.size === 0 ) { return; }