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.
This commit is contained in:
Raymond Hill 2023-05-11 11:46:31 -04:00
parent c1ac09b96a
commit 1a9a8aae0c
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -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; }