Bug 1569244 - Only uninstall extensions if they are in the profile. r=kmag
authorMichael Kaply <mozilla@kaply.com>
Fri, 26 Jul 2019 19:23:55 +0000
changeset 484943 2248a49a2dfd6e23351e78103e619c3febf46625
parent 484942 117b2dc7150e660a40210a004e667e8b822e9a7d
child 484944 dccb1e54f4814561d9e21944b3b2ead880aad7bc
push id36352
push userdvarga@mozilla.com
push dateSat, 27 Jul 2019 09:31:08 +0000
treeherdermozilla-central@8007ff804e99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1569244
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1569244 - Only uninstall extensions if they are in the profile. r=kmag Differential Revision: https://phabricator.services.mozilla.com/D39539
browser/components/enterprisepolicies/Policies.jsm
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -747,17 +747,21 @@ var Policies = {
                 log.debug(`Add-on ID (${addon.id}) couldn't be uninstalled.`);
               }
             }
           }
         }
       }
       if (blockAllExtensions) {
         for (let addon of addons) {
-          if (addon.isSystem || addon.isBuiltin) {
+          if (
+            addon.isSystem ||
+            addon.isBuiltin ||
+            !(addon.scope & AddonManager.SCOPE_PROFILE)
+          ) {
             continue;
           }
           if (!allowedExtensions.includes(addon.id)) {
             try {
               // Can't use the addon from getActiveAddons since it doesn't have uninstall.
               let addonToUninstall = await AddonManager.getAddonByID(addon.id);
               await addonToUninstall.uninstall();
             } catch (e) {