Exclude Update stuff from about:support if the updater isn't built.

This commit is contained in:
janekptacijarabaci 2017-07-30 07:44:13 +02:00 • committed by Roy Tam
commit e268676945
3 changed files with 13 additions and 10 deletions

View file

@ -968,31 +968,32 @@ function safeModeRestart() {
* Set up event listeners for buttons. * Set up event listeners for buttons.
*/ */
function setupEventListeners() { function setupEventListeners() {
$("show-update-history-button").addEventListener("click", function (event) { #ifdef MOZ_UPDATER
$("show-update-history-button").addEventListener("click", function(event) {
var prompter = Cc["@mozilla.org/updates/update-prompt;1"].createInstance(Ci.nsIUpdatePrompt); var prompter = Cc["@mozilla.org/updates/update-prompt;1"].createInstance(Ci.nsIUpdatePrompt);
prompter.showUpdateHistory(window); prompter.showUpdateHistory(window);
}); });
$("reset-box-button").addEventListener("click", function (event) { #endif
$("reset-box-button").addEventListener("click", function(event) {
ResetProfile.openConfirmationDialog(window); ResetProfile.openConfirmationDialog(window);
}); });
$("copy-raw-data-to-clipboard").addEventListener("click", function (event) { $("copy-raw-data-to-clipboard").addEventListener("click", function(event) {
copyRawDataToClipboard(this); copyRawDataToClipboard(this);
}); });
$("copy-to-clipboard").addEventListener("click", function (event) { $("copy-to-clipboard").addEventListener("click", function(event) {
copyContentsToClipboard(); copyContentsToClipboard();
}); });
$("profile-dir-button").addEventListener("click", function (event) { $("profile-dir-button").addEventListener("click", function(event) {
openProfileDirectory(); openProfileDirectory();
}); });
$("restart-in-safe-mode-button").addEventListener("click", function (event) { $("restart-in-safe-mode-button").addEventListener("click", function(event) {
if (Services.obs.enumerateObservers("restart-in-safe-mode").hasMoreElements()) { if (Services.obs.enumerateObservers("restart-in-safe-mode").hasMoreElements()) {
Services.obs.notifyObservers(null, "restart-in-safe-mode", ""); Services.obs.notifyObservers(null, "restart-in-safe-mode", "");
} } else {
else {
safeModeRestart(); safeModeRestart();
} }
}); });
$("verify-place-integrity-button").addEventListener("click", function (event) { $("verify-place-integrity-button").addEventListener("click", function(event) {
PlacesDBUtils.checkAndFixDatabase(function(aLog) { PlacesDBUtils.checkAndFixDatabase(function(aLog) {
let msg = aLog.join("\n"); let msg = aLog.join("\n");
$("verify-place-result").style.display = "block"; $("verify-place-result").style.display = "block";

View file

@ -99,6 +99,7 @@
</tr> </tr>
#ifndef ANDROID #ifndef ANDROID
#ifdef MOZ_UPDATER
<tr class="no-copy"> <tr class="no-copy">
<th class="column"> <th class="column">
&aboutSupport.appBasicsUpdateHistory; &aboutSupport.appBasicsUpdateHistory;
@ -111,6 +112,7 @@
</td> </td>
</tr> </tr>
#endif #endif
#endif
#ifdef MOZ_UPDATER #ifdef MOZ_UPDATER
<tr> <tr>

View file

@ -37,7 +37,7 @@ var gUpdateHistory = {
var element = document.createElementNS(NS_XUL, "update"); var element = document.createElementNS(NS_XUL, "update");
this._view.appendChild(element); this._view.appendChild(element);
element.name = bundle.getFormattedString("updateFullName", element.name = bundle.getFormattedString("updateFullName",
[update.name, update.buildID]); [update.name, (update.buildID ? update.buildID : "-")]);
element.type = bundle.getString("updateType_" + update.type); element.type = bundle.getString("updateType_" + update.type);
element.installDate = this._formatDate(update.installDate); element.installDate = this._formatDate(update.installDate);
if (update.detailsURL) if (update.detailsURL)