commit 8c2dca895b8a9eea73856fd1ba251ff19ff7beb1
parent 020575f646049c843a22a40d7c70fa50858da76d
Author: Eemeli Aro <eemeli@mozilla.com>
Date: Thu, 30 Oct 2025 10:57:46 +0000
Bug 1773096 - Remove browser.menu.showCharacterEncoding pref as unused. r=glandium,jdescottes,firefox-desktop-core-reviewers ,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D267411
Diffstat:
4 files changed, 19 insertions(+), 28 deletions(-)
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
@@ -1796,10 +1796,6 @@ pref("services.sync.syncedTabs.showRemoteIcons", true);
// Anything <= 0 means disabled
pref("services.sync.syncedTabs.syncDelayAfterTabChange", 5000);
-// Whether the character encoding menu is under the main Firefox button. This
-// preference is a string so that localizers can alter it.
-pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
-
// Whether prompts should be content modal (1) tab modal (2) or window modal(3) by default
// This is a fallback value for when prompt callers do not specify a modalType.
pref("prompts.defaultModalType", 3);
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
@@ -594,14 +594,6 @@ var CustomizableUIInternal = {
defaultPlacements.splice(-1, 0, "developer-button");
}
- let showCharacterEncoding = Services.prefs.getComplexValue(
- "browser.menu.showCharacterEncoding",
- Ci.nsIPrefLocalizedString
- ).data;
- if (showCharacterEncoding == "true") {
- defaultPlacements.push("characterencoding-button");
- }
-
savedPanelPlacements = savedPanelPlacements.filter(
id => !defaultPlacements.includes(id)
);
diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties
@@ -246,16 +246,6 @@ troubleshootModeRestartPromptTitle=Restart %S in Troubleshoot Mode?
troubleshootModeRestartPromptMessage=Your extensions, themes, and custom settings will be temporarily disabled.
troubleshootModeRestartButton=Restart
-# LOCALIZATION NOTE (browser.menu.showCharacterEncoding): Set to the string
-# "true" (spelled and capitalized exactly that way) to show the "Text
-# Encoding" menu in the main Firefox button on Windows. Any other value will
-# hide it. Regardless of the value of this setting, the "Text Encoding"
-# menu will always be accessible via the "Browser Tools" menu.
-# This is not a string to translate; it just controls whether the menu shows
-# up in the Firefox button. If users frequently use the "Text Encoding"
-# menu, set this to "true". Otherwise, you can leave it as "false".
-browser.menu.showCharacterEncoding=false
-
# Process hang reporter
# LOCALIZATION NOTE (processHang.selected_tab.label): %1$S is the name of the product (e.g., Firefox)
processHang.selected_tab.label = This page is slowing down %1$S. To speed up your browser, stop this page.
diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_prefs.py b/testing/marionette/harness/marionette_harness/tests/unit/test_prefs.py
@@ -100,18 +100,31 @@ class TestPreferences(MarionetteTestCase):
self.assertEqual(self.marionette.get_pref(pref_default), "default_value")
def test_get_pref_value_type(self):
- # Without a given value type the properties URL will be returned only
- pref_complex = "browser.menu.showCharacterEncoding"
- properties_file = "chrome://browser/locale/browser.properties"
+ pref_complex = "marionette.test.complex"
+
+ # Set a nsIFile complex preference pointing to a temporary folder.
+ with self.marionette.using_context(self.marionette.CONTEXT_CHROME):
+ expected_path = self.marionette.execute_script(
+ """
+ let pref = arguments[0];
+ let tempDir = Services.dirsvc.get("TmpD", Ci.nsIFile);
+ Services.prefs.setComplexValue(pref, Ci.nsIFile, tempDir);
+ return tempDir.path;
+ """,
+ script_args=(pref_complex,),
+ )
+
+ # Read the complex preference without a value_type,
+ # the path as a string should be returned.
self.assertEqual(
- self.marionette.get_pref(pref_complex, default_branch=True), properties_file
+ self.marionette.get_pref(pref_complex, default_branch=False), expected_path
)
# Otherwise the property named like the pref will be translated
value = self.marionette.get_pref(
- pref_complex, default_branch=True, value_type="nsIPrefLocalizedString"
+ pref_complex, default_branch=False, value_type="nsIFile"
)
- self.assertNotEqual(value, properties_file)
+ self.assertNotEqual(value, expected_path)
def test_set_prefs(self):
# By default none of the preferences are set