diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 21:49:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 21:49:04 +0200 |
commit | 39dac57259cff8b61db0b22cb2ad0a8adb02692e (patch) | |
tree | 52a026cc8c22793eb17fd0f5e22adce1ae08a1dd /toolkit/content/aboutSupport.js | |
parent | a1cce3b2b00bbd9f4983013ddd8934a7bccb9e99 (diff) | |
parent | c2d9ab62f3d097c9e0e00184cab1f546554f5eaa (diff) | |
download | UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.gz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.lz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.xz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.zip |
Merge branch 'redwood' into 28.9-platform
Diffstat (limited to 'toolkit/content/aboutSupport.js')
-rw-r--r-- | toolkit/content/aboutSupport.js | 84 |
1 files changed, 17 insertions, 67 deletions
diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index 5c889c18f..f9a0abcb0 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -10,7 +10,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Troubleshoot.jsm"); Cu.import("resource://gre/modules/ResetProfile.jsm"); -Cu.import("resource://gre/modules/AppConstants.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm"); @@ -42,7 +41,7 @@ var snapshotFormatters = { $("os-box").textContent = data.osVersion; $("binary-box").textContent = Services.dirsvc.get("XREExeF", Ci.nsIFile).path; $("supportLink").href = data.supportURL; - let version = AppConstants.MOZ_APP_VERSION_DISPLAY; + let version = Services.appinfo.version; if (data.versionArch) { version += " (" + data.versionArch + ")"; } @@ -197,23 +196,23 @@ var snapshotFormatters = { delete data.info; } - if (AppConstants.NIGHTLY_BUILD) { - let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils); - let gpuProcessPid = windowUtils.gpuProcessPid; +#ifdef NIGHTLY_BUILD + let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils); + let gpuProcessPid = windowUtils.gpuProcessPid; - if (gpuProcessPid != -1) { - let gpuProcessKillButton = $.new("button"); + if (gpuProcessPid != -1) { + let gpuProcessKillButton = $.new("button"); - gpuProcessKillButton.addEventListener("click", function() { - windowUtils.terminateGPUProcess(); - }); + gpuProcessKillButton.addEventListener("click", function() { + windowUtils.terminateGPUProcess(); + }); - gpuProcessKillButton.textContent = strings.GetStringFromName("gpuProcessKillButton"); - addRow("diagnostics", "GPUProcessPid", gpuProcessPid); - addRow("diagnostics", "GPUProcess", [gpuProcessKillButton]); - } + gpuProcessKillButton.textContent = strings.GetStringFromName("gpuProcessKillButton"); + addRow("diagnostics", "GPUProcessPid", gpuProcessPid); + addRow("diagnostics", "GPUProcess", [gpuProcessKillButton]); } +#endif // graphics-failures-tbody tbody if ("failures" in data) { @@ -565,42 +564,6 @@ function sortedArrayFromObject(obj) { return tuples; } -function copyRawDataToClipboard(button) { - if (button) - button.disabled = true; - try { - Troubleshoot.snapshot(function (snapshot) { - if (button) - button.disabled = false; - let str = Cc["@mozilla.org/supports-string;1"]. - createInstance(Ci.nsISupportsString); - str.data = JSON.stringify(snapshot, undefined, 2); - let transferable = Cc["@mozilla.org/widget/transferable;1"]. - createInstance(Ci.nsITransferable); - transferable.init(getLoadContext()); - transferable.addDataFlavor("text/unicode"); - transferable.setTransferData("text/unicode", str, str.data.length * 2); - Cc["@mozilla.org/widget/clipboard;1"]. - getService(Ci.nsIClipboard). - setData(transferable, null, Ci.nsIClipboard.kGlobalClipboard); - if (AppConstants.platform == "android") { - // Present a toast notification. - let message = { - type: "Toast:Show", - message: stringBundle().GetStringFromName("rawDataCopied"), - duration: "short" - }; - Services.androidBridge.handleGeckoMessage(message); - } - }); - } - catch (err) { - if (button) - button.disabled = false; - throw err; - } -} - function getLoadContext() { return window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebNavigation) @@ -636,16 +599,6 @@ function copyContentsToClipboard() { let clipboard = Cc["@mozilla.org/widget/clipboard;1"] .getService(Ci.nsIClipboard); clipboard.setData(transferable, null, clipboard.kGlobalClipboard); - - if (AppConstants.platform == "android") { - // Present a toast notification. - let message = { - type: "Toast:Show", - message: stringBundle().GetStringFromName("textCopied"), - duration: "short" - }; - Services.androidBridge.handleGeckoMessage(message); - } } // Return the plain text representation of an element. Do a little bit @@ -654,10 +607,10 @@ function createTextForElement(elem) { let serializer = new Serializer(); let text = serializer.serialize(elem); +#ifdef XP_WIN // Actual CR/LF pairs are needed for some Windows text editors. - if (AppConstants.platform == "win") { - text = text.replace(/\n/g, "\r\n"); - } + text = text.replace(/\n/g, "\r\n"); +#endif return text; } @@ -913,9 +866,6 @@ function setupEventListeners() { $("reset-box-button").addEventListener("click", function(event) { ResetProfile.openConfirmationDialog(window); }); - $("copy-raw-data-to-clipboard").addEventListener("click", function(event) { - copyRawDataToClipboard(this); - }); $("copy-to-clipboard").addEventListener("click", function(event) { copyContentsToClipboard(); }); |