Prevent unchecked default lists from being visually collapsed

Related issue:
- https://github.com/gorhill/uBlock/issues/2303
This commit is contained in:
Raymond Hill 2021-05-19 09:34:46 -04:00
parent 10376090ca
commit 7508700892
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
3 changed files with 11 additions and 1 deletions

View File

@ -57,7 +57,7 @@ body.hideUnused #listsOfBlockedHostsPrompt::before,
margin-inline-start: 0.6em;
-webkit-margin-start: 0.6em;
}
.groupEntry:not([data-groupkey="user"]) .listEntry.unused {
.groupEntry:not([data-groupkey="user"]) .listEntry:not(.isDefault).unused {
display: none;
}
.listEntry > * {

View File

@ -120,6 +120,7 @@ const renderFilterLists = function(soft) {
} else {
li.classList.remove('mustread');
}
li.classList.toggle('isDefault', entry.isDefault === true);
li.classList.toggle('unused', hideUnused && !on);
}
// https://github.com/gorhill/uBlock/issues/1429

View File

@ -873,6 +873,15 @@ api.metadata = async function() {
for ( const assetKey in assetDict ) {
const assetEntry = assetDict[assetKey];
const cacheEntry = cacheDict[assetKey];
if (
assetEntry.content === 'filters' &&
assetEntry.external !== true
) {
assetEntry.isDefault =
assetEntry.off === undefined ||
assetEntry.off === true &&
µBlock.listMatchesEnvironment(assetEntry);
}
if ( cacheEntry ) {
assetEntry.cached = true;
assetEntry.writeTime = cacheEntry.writeTime;