mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-08 16:27:31 +09:00
moebius#173: Fix up "about:" page
https://github.com/MoonchildProductions/moebius/issues/173
This commit is contained in:
parent
d37246737b
commit
5371575837
4 changed files with 26 additions and 13 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
<div id="aboutLogoContainer">
|
||||
<a id="vendorURL">
|
||||
<img src="about:logo" alt="&brandShortName;"/>
|
||||
<p id="version">&about.version;</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
@ -33,7 +32,9 @@
|
|||
<li>&about.license.beforeTheLink;<a href="about:license">&about.license.linkTitle;</a>&about.license.afterTheLink;</li>
|
||||
<li hidden="true">&about.relnotes.beforeTheLink;<a id="releaseNotesURL">&about.relnotes.linkTitle;</a>&about.relnotes.afterTheLink;</li>
|
||||
<li>&about.buildconfig.beforeTheLink;<a href="about:buildconfig">&about.buildconfig.linkTitle;</a>&about.buildconfig.afterTheLink;</li>
|
||||
<li id="version">&about.version;</li>
|
||||
<li id="buildID">&about.buildIdentifier;</li>
|
||||
<li id="userAgent">&about.userAgent;</li>
|
||||
<script type="application/javascript" src="chrome://global/content/about.js"/>
|
||||
</ul>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue