Bug 1358907 Part 1b Handle types argument to getActiveAddons() r=mossop
authorAndrew Swan <aswan@mozilla.com>
Fri, 30 Jun 2017 11:48:11 -0700
changeset 367885 51a1bde393d2b91edb432696028b0116860bc7e5
parent 367884 66528bf3d70ddd5a43a9017605dd4942ed09d122
child 367886 3baed119e19870bd5e4e7787f96d5286aeab60a5
push id32149
push userarchaeopteryx@coole-files.de
push dateSun, 09 Jul 2017 09:18:32 +0000
treeherdermozilla-central@858be731fb01 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1358907
milestone56.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 1358907 Part 1b Handle types argument to getActiveAddons() r=mossop 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,