Bug 645485 - Sort list of extensions in about:support. r=dao
authorMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Mon, 04 Apr 2011 06:32:47 +0200
changeset 64651 e4811650797ba489c381e7a79c4461245cd1c9db
parent 64650 038340b47ab98dd16c99c098deb1e474d8ee78c6
child 64652 f76c34fd72288f0c3b8bb2467043a0068e3e7a18
push idunknown
push userunknown
push dateunknown
reviewersdao
bugs645485
milestone2.2a1pre
Bug 645485 - Sort list of extensions in about:support. r=dao
toolkit/content/aboutSupport.js
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -104,16 +104,26 @@ window.onload = function () {
   // Update the other sections.
   populatePreferencesSection();
   populateExtensionsSection();
   populateGraphicsSection();
 }
 
 function populateExtensionsSection() {
   AddonManager.getAddonsByTypes(["extension"], function(extensions) {
+    extensions.sort(function(a,b) {
+      if (a.isActive != b.isActive)
+        return b.isActive ? 1 : -1;
+      let lc = a.name.localeCompare(b.name);
+      if (lc != 0)
+        return lc;
+      if (a.version != b.version)
+        return a.version > b.version ? 1 : -1;
+      return 0;
+    });
     let trExtensions = [];
     for (let i = 0; i < extensions.length; i++) {
       let extension = extensions[i];
       let tr = createParentElement("tr", [
         createElement("td", extension.name),
         createElement("td", extension.version),
         createElement("td", extension.isActive),
         createElement("td", extension.id),