Bug 1720961 - Fix Firefox Translations AddonID r=mixedpuppy

Fix Firefox Translations AddonID and uninstall the old reference

Differential Revision: https://phabricator.services.mozilla.com/D120121
This commit is contained in:
Andre Natal 2021-07-19 15:41:27 +00:00
parent 6579e91786
commit b0c578a3b8
2 changed files with 11 additions and 1 deletions

View File

@ -1977,6 +1977,16 @@ BrowserGlue.prototype = {
_monitorTranslationsPref() {
const PREF = "extensions.translations.disabled";
const ID = "firefox-translations@mozilla.org";
const oldID = "firefox-infobar-ui-bergamot-browser-extension@browser.mt";
// First, try to uninstall the old extension, if exists.
(async () => {
let addon = await AddonManager.getAddonByID(oldID);
if (addon) {
addon.uninstall().catch(Cu.reportError);
}
})();
const _checkTranslationsPref = async () => {
let addon = await AddonManager.getAddonByID(ID);
let disabled = Services.prefs.getBoolPref(PREF, false);

View File

@ -129,7 +129,7 @@
},
"applications": {
"gecko": {
"id": "firefox-infobar-ui-bergamot-browser-extension@browser.mt",
"id": "firefox-translations@mozilla.org",
"strict_min_version": "90.0a1"
}
}