Skip to content

Commit

Permalink
[mv3] Use navigator.languages instead of i18n.getAcceptLanguages
Browse files Browse the repository at this point in the history
Related issue:
- w3c/webextensions#107
  • Loading branch information
gorhill committed Oct 17, 2022
1 parent d2cece5 commit fa21f97
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions platform/mv3/extension/js/ruleset-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit fa21f97

Please sign in to comment.