Bug 1569244 - Only uninstall extensions if they are in the profile. r=kmag a=RyanVM
authorMichael Kaply <mozilla@kaply.com>
Fri, 26 Jul 2019 19:23:55 +0000
changeset 541677 7cda7678442f2459ac5c58bee5e36295b238c63d
parent 541676 30a3d6b7d0dc191ba03ea8ee8fc669bc1fea6703
child 541678 d410cc620eb708d9625de3a9c22411e736fc4920
push id11676
push userarchaeopteryx@coole-files.de
push dateThu, 01 Aug 2019 10:00:59 +0000
treeherdermozilla-beta@0ea23ef02519 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, RyanVM
bugs1569244
milestone69.0
Bug 1569244 - Only uninstall extensions if they are in the profile. r=kmag a=RyanVM 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) {