From 7da25d73be6cbc13f35041c6ad9c4e242cc1eb13 Mon Sep 17 00:00:00 2001 From: Roy Tam Date: Thu, 11 Jul 2019 22:32:57 +0800 Subject: [PATCH] revert and rewrite "Remove e10s info from about:support (f7f7224de)" to not relying on string bundle (i.e. becoming non-translable) in order to compatible to official language packs --- toolkit/content/aboutSupport.js | 26 +++++++++++++++++++ toolkit/content/aboutSupport.xhtml | 9 +++++++ toolkit/modules/Troubleshoot.jsm | 12 +++++++++ .../tests/browser/browser_Troubleshoot.js | 7 +++++ 4 files changed, 54 insertions(+) diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index 06470f9668..b67c830822 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -53,6 +53,32 @@ var snapshotFormatters = { if (data.updateChannel) $("updatechannel-box").textContent = data.updateChannel; + let statusText = "unknown status"; + + // Whitelist of known values with string descriptions: + switch (data.autoStartStatus) { + case 0: + statusText = "Enabled by user"; break; + case 1: + statusText = "Enabled by default"; break; + case 2: + statusText = "Disabled"; break; + case 4: + statusText = "Disabled by accessibility tools"; break; + case 6: + statusText = "Disabled by unsupported text input"; break; + case 7: + statusText = "Disabled by add-ons"; break; + case 8: + statusText = "Disabled forcibly"; break; + + case 10: + statusText = (Services.appinfo.OS == "Darwin" ? "OS X 10.6 - 10.8" : "Windows XP"); + break; + } + + $("multiprocess-box").textContent = data.numRemoteWindows + "/" + data.numTotalWindows + " (" statusText + ")"; + $("safemode-box").textContent = data.safeMode; }, diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml index fff86dff67..6190363cb2 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -234,6 +234,15 @@ + + + Multiprocess Windows + + + + + + &aboutSupport.appBasicsSafeMode; diff --git a/toolkit/modules/Troubleshoot.jsm b/toolkit/modules/Troubleshoot.jsm index 6ee6cb54e5..8d84eec8c3 100644 --- a/toolkit/modules/Troubleshoot.jsm +++ b/toolkit/modules/Troubleshoot.jsm @@ -220,6 +220,18 @@ var dataProviders = { } } + data.remoteAutoStart = Services.appinfo.browserTabsRemoteAutostart; + + try { + let e10sStatus = Cc["@mozilla.org/supports-PRUint64;1"] + .createInstance(Ci.nsISupportsPRUint64); + let appinfo = Services.appinfo.QueryInterface(Ci.nsIObserver); + appinfo.observe(e10sStatus, "getE10SBlocked", ""); + data.autoStartStatus = e10sStatus.data; + } catch (e) { + data.autoStartStatus = -1; + } + done(data); }, diff --git a/toolkit/modules/tests/browser/browser_Troubleshoot.js b/toolkit/modules/tests/browser/browser_Troubleshoot.js index ebc4de1f92..4124be1fb3 100644 --- a/toolkit/modules/tests/browser/browser_Troubleshoot.js +++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js @@ -126,6 +126,13 @@ const SNAPSHOT_SCHEMA = { supportURL: { type: "string", }, + remoteAutoStart: { + type: "boolean", + required: true, + }, + autoStartStatus: { + type: "number", + }, numTotalWindows: { type: "number", },