[mv3] Collect/apply highly generic cosmetic exceptions across lists

Related issues:
- https://github.com/uBlockOrigin/uBOL-home/issues/365
- https://github.com/uBlockOrigin/uAssets/issues/28770
- https://github.com/uBlockOrigin/uAssets/issues/28129
This commit is contained in:
Raymond Hill 2025-06-10 14:57:41 -04:00
parent deb3247ea2
commit 76d8b97869
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -854,18 +854,18 @@ async function processGenericHighCosmeticFilters(
.filter(a => a.key === undefined)
.map(a => a.selector)
);
// https://github.com/uBlockOrigin/uBOL-home/issues/365
if ( genericExceptionList ) {
const genericExceptionSet = new Set(
genericExceptionList
.filter(a => a.key === undefined)
.map(a => a.selector)
);
for ( const selector of genericExceptionSet ) {
if ( genericSelectorSet.has(selector) === false ) { continue; }
genericSelectorSet.delete(selector);
log(`\tRemoving excepted highly generic filter ##${selector}`);
for ( const entry of genericExceptionList ) {
if ( entry.key !== undefined ) { continue; }
globalHighlyGenericExceptionSet.add(entry.selector);
}
}
for ( const selector of globalHighlyGenericExceptionSet ) {
if ( genericSelectorSet.has(selector) === false ) { continue; }
genericSelectorSet.delete(selector);
log(`\tRemoving excepted highly generic filter ##${selector}`);
}
if ( genericSelectorSet.size === 0 ) { return 0; }
const selectorLists = Array.from(genericSelectorSet).sort().join(',\n');
const originalScriptletMap = await loadAllSourceScriptlets();
@ -888,6 +888,8 @@ async function processGenericHighCosmeticFilters(
return genericSelectorSet.size;
}
const globalHighlyGenericExceptionSet = new Set();
/******************************************************************************/
// This merges selectors which are used by the same hostnames