1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

[mv3] Use navigator.languages instead of i18n.getAcceptLanguages

Related issue:
- https://github.com/w3c/webextensions/issues/107
This commit is contained in:
Raymond Hill 2022-10-17 08:13:48 -04:00
parent d2cece5efe
commit fa21f97b68
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -348,11 +348,9 @@ async function defaultRulesetsFromLanguage() {
const langSet = new Set();
await i18n.getAcceptLanguages().then(langs => {
for ( const lang of langs.map(dropCountry) ) {
langSet.add(lang);
}
});
for ( const lang of navigator.languages.map(dropCountry) ) {
langSet.add(lang);
}
langSet.add(dropCountry(i18n.getUILanguage()));
const reTargetLang = new RegExp(