From 0b26d810bdb8ce46fb68f3057e551583f085848d Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 13 Apr 2018 20:55:39 +0200 Subject: moebius#173: Fix up "about:" page https://github.com/MoonchildProductions/moebius/issues/173 --- toolkit/content/about.js | 23 ++++++++++++++++++++--- toolkit/content/about.xhtml | 3 ++- toolkit/locales/en-US/chrome/global/about.dtd | 5 +++-- toolkit/themes/shared/about.css | 8 +------- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/toolkit/content/about.js b/toolkit/content/about.js index ae467d07a..c27916c10 100644 --- a/toolkit/content/about.js +++ b/toolkit/content/about.js @@ -5,14 +5,24 @@ // get release notes and vendor URL from prefs var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"] .getService(Components.interfaces.nsIURLFormatter); -var releaseNotesURL = formatter.formatURLPref("app.releaseNotesURL"); +var releaseNotesURL; +try { + releaseNotesURL = formatter.formatURLPref("app.releaseNotesURL"); +} catch(e) { + releaseNotesURL = "about:blank"; +} if (releaseNotesURL != "about:blank") { var relnotes = document.getElementById("releaseNotesURL"); relnotes.setAttribute("href", releaseNotesURL); relnotes.parentNode.removeAttribute("hidden"); } -var vendorURL = formatter.formatURLPref("app.vendorURL"); +var vendorURL; +try { + vendorURL = formatter.formatURLPref("app.vendorURL"); +} catch(e) { + vendorURL = "about:blank"; +} if (vendorURL != "about:blank") { var vendor = document.getElementById("vendorURL"); vendor.setAttribute("href", vendorURL); @@ -25,8 +35,15 @@ var versionNum = Components.classes["@mozilla.org/xre/app-info;1"] var version = document.getElementById("version"); version.textContent += " " + versionNum; +// insert the buildid of the XUL application +var BuildIDVal = Components.classes["@mozilla.org/xre/app-info;1"] + .getService(Components.interfaces.nsIXULAppInfo) + .appBuildID; +var buildID = document.getElementById("buildID"); +buildID.textContent += " " + BuildIDVal.slice(0,-6); + // append user agent var ua = navigator.userAgent; if (ua) { - document.getElementById("buildID").textContent += " " + ua; + document.getElementById("userAgent").textContent += " " + ua; } diff --git a/toolkit/content/about.xhtml b/toolkit/content/about.xhtml index d5245928f..1f57ddcc3 100644 --- a/toolkit/content/about.xhtml +++ b/toolkit/content/about.xhtml @@ -24,7 +24,6 @@
&brandShortName; -

&about.version;

@@ -33,7 +32,9 @@
  • &about.license.beforeTheLink;&about.license.linkTitle;&about.license.afterTheLink;
  • &about.buildconfig.beforeTheLink;&about.buildconfig.linkTitle;&about.buildconfig.afterTheLink;
  • +
  • &about.version;
  • &about.buildIdentifier;
  • +
  • &about.userAgent;