mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[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:
parent
deb3247ea2
commit
76d8b97869
1 changed files with 11 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue