Bug 1245376 - do not show hidden add-ons on manual update page f?mossop draft
authorRobert Helmer <rhelmer@mozilla.com>
Fri, 12 Feb 2016 09:20:14 -0800
changeset 330781 101f4cdd9265dfeb5f5fe8579b25be8e0f3b361e
parent 330277 6f9582d410311502c1219aaf3371d0a0f2105a09
child 514250 fda0db60028fc4848da5c971d2d60e3dee057646
push id10839
push userrhelmer@mozilla.com
push dateSat, 13 Feb 2016 00:09:04 +0000
bugs1245376
milestone47.0a1
Bug 1245376 - do not show hidden add-ons on manual update page f?mossop The public method hidden() is checking that the installLocation is not for system or temporary add-ons - I don't see anywhere that locked install locations are exposed in the public API, do you think this is sufficient for this bug or should locked install locations be exposed? I think that `extensions.js` is already skipping update checks for add-ons without PERM_CAN_UPGRADE in e.g. https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/content/extensions.js#1049 but correct me if I am mistaken. The trickier part here is adding a test - providers are mocked in the mochitests, I expect we just need to mock this as well, thought I'd ask for feedback on the above while I work this out. MozReview-Commit-ID: IZBefNH45Fl
toolkit/mozapps/extensions/content/extensions.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -3581,16 +3581,20 @@ var gUpdatesView = {
       }
 
       var elements = [];
 
       for (let install of aInstallsList) {
         if (!this.isManualUpdate(install))
           continue;
 
+        // honor add-ons which should be hidden.
+        if (install.hidden)
+          continue;
+
         let item = createItem(install.existingAddon);
         item.setAttribute("upgrade", true);
         item.addEventListener("IncludeUpdateChanged", () => {
           this.maybeDisableUpdateSelected();
         }, false);
         elements.push(item);
       }