mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
[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
1 changed files with 4 additions and 2 deletions
|
@ -200,12 +200,14 @@ function registerProcedural(context, proceduralDetails) {
|
|||
const { before, filteringModeDetails, rulesetsDetails } = context;
|
||||
|
||||
const js = [];
|
||||
const hostnameMatches = [];
|
||||
const hostnameMatches = new Set();
|
||||
for ( const details of rulesetsDetails ) {
|
||||
if ( details.css.procedural === 0 ) { continue; }
|
||||
js.push(`/rulesets/scripting/procedural/${details.id}.js`);
|
||||
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 a new issue