Bug 1569244 - Only uninstall extensions if they are in the profile. r=kmag a=jcristau
authorMichael Kaply <mozilla@kaply.com>
Fri, 26 Jul 2019 19:23:55 +0000
changeset 523340 4f44285f1b6e182003ccda5e293de54efe5c1c5b
parent 523339 7e61df6fb81da8aa810d43ec672d3b35735c9041
child 523341 b870bfa864cdd810b63e5c7ddf7329afaad672ce
push id195
push userarchaeopteryx@coole-files.de
push dateFri, 09 Aug 2019 19:46:55 +0000
treeherdermozilla-esr68@67fba999b1f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, jcristau
bugs1569244
milestone68.1.0
Bug 1569244 - Only uninstall extensions if they are in the profile. r=kmag a=jcristau 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) {