mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
draft
This commit is contained in:
parent
069f1242e8
commit
7dc431780a
1 changed files with 6 additions and 5 deletions
|
|
@ -561,11 +561,6 @@ async function filteringModesToDNR(modes) {
|
|||
/******************************************************************************/
|
||||
|
||||
async function defaultRulesetsFromLanguage() {
|
||||
const [ out, rulesetDetails ] = await Promise.all([
|
||||
dnr.getEnabledRulesets(),
|
||||
getRulesetDetails(),
|
||||
]);
|
||||
|
||||
const dropCountry = lang => {
|
||||
const pos = lang.indexOf('-');
|
||||
if ( pos === -1 ) { return lang; }
|
||||
|
|
@ -583,7 +578,13 @@ async function defaultRulesetsFromLanguage() {
|
|||
`\\b(${Array.from(langSet).join('|')})\\b`
|
||||
);
|
||||
|
||||
const rulesetDetails = await getRulesetDetails();
|
||||
const out = [];
|
||||
for ( const [ id, details ] of rulesetDetails ) {
|
||||
if ( details.enabled ) {
|
||||
out.push(id);
|
||||
continue;
|
||||
}
|
||||
if ( typeof details.lang !== 'string' ) { continue; }
|
||||
if ( reTargetLang.test(details.lang) === false ) { continue; }
|
||||
out.push(id);
|
||||
|
|
|
|||
Loading…
Reference in a new issue