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
1 changed files with 5 additions and 1 deletions

View File

@ -1625,7 +1625,11 @@ self.addEventListener('hiddenSettingsChanged', ( ) => {
if ( newDefaultListset.size === 0 ) { return; } if ( newDefaultListset.size === 0 ) { return; }
if ( oldDefaultListset.size === 0 ) { if ( oldDefaultListset.size === 0 ) {
Array.from(Object.entries(oldDict)) 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]) .map(a => a[0])
.forEach(a => oldDefaultListset.add(a)); .forEach(a => oldDefaultListset.add(a));
if ( oldDefaultListset.size === 0 ) { return; } if ( oldDefaultListset.size === 0 ) { return; }