mirror of https://github.com/gorhill/uBlock.git
[mv3] Use Set instead of array to avoid spurious script updates
Spurious updates to registered content scripts would occur when using some regional lists, for example DEU would cause spurious updates to registered script `css-procedural`.
This commit is contained in:
parent
abe2ecba6b
commit
5b6fc43a2c
|
@ -200,12 +200,14 @@ function registerProcedural(context, proceduralDetails) {
|
||||||
const { before, filteringModeDetails, rulesetsDetails } = context;
|
const { before, filteringModeDetails, rulesetsDetails } = context;
|
||||||
|
|
||||||
const js = [];
|
const js = [];
|
||||||
const hostnameMatches = [];
|
const hostnameMatches = new Set();
|
||||||
for ( const details of rulesetsDetails ) {
|
for ( const details of rulesetsDetails ) {
|
||||||
if ( details.css.procedural === 0 ) { continue; }
|
if ( details.css.procedural === 0 ) { continue; }
|
||||||
js.push(`/rulesets/scripting/procedural/${details.id}.js`);
|
js.push(`/rulesets/scripting/procedural/${details.id}.js`);
|
||||||
if ( proceduralDetails.has(details.id) ) {
|
if ( proceduralDetails.has(details.id) ) {
|
||||||
hostnameMatches.push(...proceduralDetails.get(details.id));
|
for ( const hn of proceduralDetails.get(details.id) ) {
|
||||||
|
hostnameMatches.add(hn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue