mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
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:
parent
37b133bd26
commit
ca22d72b43
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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))
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user