Bug 1498827 - Ensure the webcompat report addon is disabled upon load, if extensions.webcompat-reporter.enabled=false, take two r=aswan,mixedpuppy

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

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Thomas Wisniewski 2018-10-17 15:56:27 +00:00
parent 37b133bd26
commit ca22d72b43
4 changed files with 15 additions and 6 deletions

View File

@ -275,7 +275,14 @@ function parseManifest(manifestUri) {
let [type, ...argv] = line.split(/\s+/);
if (type == "content" || type == "skin" || type == "locale") {
let chromeUri = `chrome://${argv[0]}/${type}/`;
trackChromeUri(chromeUri);
// The webcompat reporter's locale directory may not exist if
// the addon is preffed-off, and since it's a hack until we
// get bz1425104 landed, we'll just skip it for now.
if (chromeUri === "chrome://webcompat-reporter/locale/") {
gChromeMap.set("chrome://webcompat-reporter/locale/", true);
} else {
trackChromeUri(chromeUri);
}
} else if (type == "override" || type == "overlay") {
// Overlays aren't really overrides, but behave the same in
// that the overlay is only referenced if the original xul

View File

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

View File

@ -7,4 +7,3 @@ support-files =
[browser_disabled_cleanup.js]
[browser_button_state.js]
[browser_report_site_issue.js]
skip-if = !e10s && (os == "linux" && (debug || asan))

View File

@ -2452,6 +2452,11 @@ this.XPIDatabaseReconcile = {
// appDisabled depends on whether the add-on is a foreignInstall so update
aNewAddon.appDisabled = !XPIDatabase.isUsableAddon(aNewAddon);
if (aLocation.isSystem) {
const pref = `extensions.${aId.split("@")[0]}.enabled`;
aNewAddon.userDisabled = !Services.prefs.getBoolPref(pref, true);
}
if (isDetectedInstall && aNewAddon.foreignInstall) {
// Add the installation source info for the sideloaded extension.
aNewAddon.installTelemetryInfo = {