From 1cb75567ff49fda8a54b79e1a8487f0bda624758 Mon Sep 17 00:00:00 2001 From: Kai Engert Date: Tue, 13 Mar 2012 00:04:37 +0100 Subject: [PATCH] Bug 673381, patch v4 to add NSPR/NSS library version numbers to about:support, r=dtownsend --- toolkit/content/aboutSupport.js | 36 +++++++++++++++++++ toolkit/content/aboutSupport.xhtml | 10 ++++++ .../en-US/chrome/global/aboutSupport.dtd | 2 ++ .../chrome/global/aboutSupport.properties | 3 ++ 4 files changed, 51 insertions(+) diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index 8fbb2eb198a..c86d80c37e9 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -119,6 +119,7 @@ window.onload = function () { populateExtensionsSection(); populateGraphicsSection(); populateJavaScriptSection(); + populateLibVersionsSection(); } function populateExtensionsSection() { @@ -172,6 +173,41 @@ function populatePreferencesSection() { appendChildren(document.getElementById("prefs-tbody"), trPrefs); } +function populateLibVersionsSection() { + function pushInfoRow(table, name, value, value2) + { + table.push(createParentElement("tr", [ + createElement("td", name), + createElement("td", value), + createElement("td", value2), + ])); + } + + var v = null; + try { // just to be safe + v = Cc["@mozilla.org/security/nssversion;1"].getService(Ci.nsINSSVersion); + } catch(e) {} + if (!v) + return; + + let bundle = Services.strings.createBundle("chrome://global/locale/aboutSupport.properties"); + let libversions_tbody = document.getElementById("libversions-tbody"); + + let trLibs = []; + trLibs.push(createParentElement("tr", [ + createElement("th", ""), + createElement("th", bundle.GetStringFromName("minLibVersions")), + createElement("th", bundle.GetStringFromName("loadedLibVersions")), + ])); + pushInfoRow(trLibs, "NSPR", v.NSPR_MinVersion, v.NSPR_Version); + pushInfoRow(trLibs, "NSS", v.NSS_MinVersion, v.NSS_Version); + pushInfoRow(trLibs, "NSS Util", v.NSSUTIL_MinVersion, v.NSSUTIL_Version); + pushInfoRow(trLibs, "NSS SSL", v.NSSSSL_MinVersion, v.NSSSSL_Version); + pushInfoRow(trLibs, "NSS S/MIME", v.NSSSMIME_MinVersion, v.NSSSMIME_Version); + + appendChildren(libversions_tbody, trLibs); +} + function populateGraphicsSection() { function createHeader(name) { diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml index a392b9a1424..3c555da7046 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -270,6 +270,16 @@ + +

+ &aboutSupport.libraryVersionsTitle; +

+ + + + +
+ diff --git a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd index bfe1095f813..176fac2c3c2 100644 --- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd +++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd @@ -47,6 +47,8 @@ variant of aboutSupport.showDir.label. --> + + diff --git a/toolkit/locales/en-US/chrome/global/aboutSupport.properties b/toolkit/locales/en-US/chrome/global/aboutSupport.properties index 05a9e7502d8..171fed8fb09 100644 --- a/toolkit/locales/en-US/chrome/global/aboutSupport.properties +++ b/toolkit/locales/en-US/chrome/global/aboutSupport.properties @@ -40,3 +40,6 @@ driverVersion2 = Driver Version (GPU #2) driverDate2 = Driver Date (GPU #2) isGPU2Active = GPU #2 Active webglRenderer = WebGL Renderer + +minLibVersions = Expected minimum version +loadedLibVersions = Version in use