Bug 1498579 - Ensure the webcompat report addon is disabled upon load, if extensions.webcompat-reporter.enabled=false; r=aswan

Ensure the webcompat report addon is disabled upon load, if extensions.webcompat-reporter.enabled=false

Differential Revision: https://phabricator.services.mozilla.com/D8613

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Thomas Wisniewski 2018-10-12 21:23:52 +00:00
Родитель 24854801a8
Коммит 6309162ed8
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -1451,7 +1451,7 @@ BrowserGlue.prototype = {
_monitorWebcompatReporterPref() {
const PREF = "extensions.webcompat-reporter.enabled";
const ID = "webcompat-reporter@mozilla.org";
Services.prefs.addObserver(PREF, async () => {
async function checkPref() {
let addon = await AddonManager.getAddonByID(ID);
let enabled = Services.prefs.getBoolPref(PREF, false);
if (enabled && !addon.isActive) {
@ -1459,7 +1459,9 @@ BrowserGlue.prototype = {
} else if (!enabled && addon.isActive) {
await addon.disable({allowSystemAddons: true});
}
});
}
Services.prefs.addObserver(PREF, checkPref);
checkPref();
},
// All initial windows have opened.