Bug 1308981: Display system add-ons in a separate section in about:support.
MozReview-Commit-ID: 3KYFz4pOXPT
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -147,16 +147,26 @@ var snapshotFormatters = {
$.new("td", extension.name),
$.new("td", extension.version),
$.new("td", extension.isActive),
$.new("td", extension.id),
]);
}));
},
+ features: function features(data) {
+ $.append($("features-tbody"), data.map(function(feature) {
+ return $.new("tr", [
+ $.new("td", feature.name),
+ $.new("td", feature.version),
+ $.new("td", feature.id),
+ ]);
+ }));
+ },
+
experiments: function experiments(data) {
$.append($("experiments-tbody"), data.map(function(experiment) {
return $.new("tr", [
$.new("td", experiment.name),
$.new("td", experiment.id),
$.new("td", experiment.description),
$.new("td", experiment.active),
$.new("td", experiment.endDate),
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -295,16 +295,40 @@
<a href="about:crashes" id="crashes-allReportsWithPending" class="block">&aboutSupport.crashes.allReports;</a>
</p>
<p id="crashes-noConfig" class="hidden no-copy">&aboutSupport.crashes.noConfig;</p>
#endif
<!-- - - - - - - - - - - - - - - - - - - - - -->
<h2 class="major-section">
+ &aboutSupport.featuresTitle;
+ </h2>
+
+ <table>
+ <thead>
+ <tr>
+ <th>
+ &aboutSupport.featureName;
+ </th>
+ <th>
+ &aboutSupport.featureVersion;
+ </th>
+ <th>
+ &aboutSupport.featureId;
+ </th>
+ </tr>
+ </thead>
+ <tbody id="features-tbody">
+ </tbody>
+ </table>
+
+ <!-- - - - - - - - - - - - - - - - - - - - - -->
+
+ <h2 class="major-section">
&aboutSupport.extensionsTitle;
</h2>
<table>
<thead>
<tr>
<th>
&aboutSupport.extensionName;
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
@@ -20,16 +20,21 @@ This is likely the same like id.heading
<!ENTITY aboutSupport.crashes.noConfig "This application has not been configured to display crash reports.">
<!ENTITY aboutSupport.extensionsTitle "Extensions">
<!ENTITY aboutSupport.extensionName "Name">
<!ENTITY aboutSupport.extensionEnabled "Enabled">
<!ENTITY aboutSupport.extensionVersion "Version">
<!ENTITY aboutSupport.extensionId "ID">
+<!ENTITY aboutSupport.featuresTitle "&brandShortName; Features">
+<!ENTITY aboutSupport.featureName "Name">
+<!ENTITY aboutSupport.featureVersion "Version">
+<!ENTITY aboutSupport.featureId "ID">
+
<!ENTITY aboutSupport.experimentsTitle "Experimental Features">
<!ENTITY aboutSupport.experimentName "Name">
<!ENTITY aboutSupport.experimentId "ID">
<!ENTITY aboutSupport.experimentDescription "Description">
<!ENTITY aboutSupport.experimentActive "Active">
<!ENTITY aboutSupport.experimentEndDate "End Date">
<!ENTITY aboutSupport.experimentHomepage "Homepage">
<!ENTITY aboutSupport.experimentBranch "Branch">
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -236,16 +236,17 @@ var dataProviders = {
const keyMozilla = Services.urlFormatter.formatURL("%MOZILLA_API_KEY%").trim();
data.keyMozillaFound = keyMozilla != "no-mozilla-api-key" && keyMozilla.length > 0;
done(data);
},
extensions: function extensions(done) {
AddonManager.getAddonsByTypes(["extension"], function(extensions) {
+ extensions = extensions.filter(e => !e.isSystem);
extensions.sort(function(a, b) {
if (a.isActive != b.isActive)
return b.isActive ? 1 : -1;
// In some unfortunate cases addon names can be null.
let aname = a.name || null;
let bname = b.name || null;
let lc = aname.localeCompare(bname);
@@ -260,16 +261,40 @@ var dataProviders = {
return props.reduce(function(extData, prop) {
extData[prop] = ext[prop];
return extData;
}, {});
}));
});
},
+ features: function features(done) {
+ AddonManager.getAddonsByTypes(["extension"], function(features) {
+ features = features.filter(f => f.isSystem);
+ features.sort(function(a, b) {
+ // In some unfortunate cases addon names can be null.
+ let aname = a.name || null;
+ let bname = b.name || null;
+ let lc = aname.localeCompare(bname);
+ if (lc != 0)
+ return lc;
+ if (a.version != b.version)
+ return a.version > b.version ? 1 : -1;
+ return 0;
+ });
+ let props = ["name", "version", "id"];
+ done(features.map(function(f) {
+ return props.reduce(function(fData, prop) {
+ fData[prop] = f[prop];
+ return fData;
+ }, {});
+ }));
+ });
+ },
+
experiments: function experiments(done) {
if (Experiments === undefined) {
done([]);
return;
}
// getExperiments promises experiment history
Experiments.instance().getExperiments().then(
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js
@@ -200,16 +200,37 @@ const SNAPSHOT_SCHEMA = {
},
isActive: {
required: true,
type: "boolean",
},
},
},
},
+ features: {
+ required: true,
+ type: "array",
+ items: {
+ type: "object",
+ properties: {
+ name: {
+ required: true,
+ type: "string",
+ },
+ version: {
+ required: true,
+ type: "string",
+ },
+ id: {
+ required: true,
+ type: "string",
+ },
+ },
+ },
+ },
modifiedPreferences: {
required: true,
type: "object",
},
lockedPreferences: {
required: true,
type: "object",
},