Bug 1358907 Part 1b Handle types argument to getActiveAddons()
MozReview-Commit-ID: BMc7E69t9bu
--- 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,