[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
1 changed files with 3 additions and 5 deletions

View File

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