Bug 1358907 Part 1b Handle types argument to getActiveAddons() draft
authorAndrew Swan <aswan@mozilla.com>
Fri, 30 Jun 2017 11:48:11 -0700
changeset 605542 0c82971f8390d5519291fc4560535d26b8868c22
parent 605370 5eeee16f1659ca1f7c4e28e5834d051eb060eafc
child 605543 7913e2acfdf14f490a1e0b8dd55823b8350dfeef
push id67445
push useraswan@mozilla.com
push dateFri, 07 Jul 2017 22:57:23 +0000
bugs1358907
milestone56.0a1
Bug 1358907 Part 1b Handle types argument to getActiveAddons() MozReview-Commit-ID: BMc7E69t9bu
toolkit/mozapps/extensions/internal/XPIProvider.jsm
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -3607,16 +3607,19 @@ this.XPIProvider = {
     // Construct addon-like objects with the information we already
     // have in memory.
     if (!XPIStates.db) {
       return Promise.reject(new Error("XPIStates not yet initialized"));
     }
 
     let result = [];
     for (let addon of XPIStates.enabledAddons()) {
+      if (aTypes && !aTypes.includes(addon.type)) {
+        continue;
+      }
       let location = this.installLocationsByName[addon.location.name];
       let scope, isSystem;
       if (location) {
         ({scope, isSystem} = location);
       }
       result.push({
         id: addon.id,
         version: addon.version,