Skip to content

Commit 8c2dca8

Browse files
eemeliearo@mozilla.com
authored andcommitted
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
1 parent 020575f commit 8c2dca8

File tree

4 files changed

+19
-28
lines changed

4 files changed

+19
-28
lines changed

browser/app/profile/firefox.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,10 +1796,6 @@ pref("services.sync.syncedTabs.showRemoteIcons", true);
17961796
// Anything <= 0 means disabled
17971797
pref("services.sync.syncedTabs.syncDelayAfterTabChange", 5000);
17981798

1799-
// Whether the character encoding menu is under the main Firefox button. This
1800-
// preference is a string so that localizers can alter it.
1801-
pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
1802-
18031799
// Whether prompts should be content modal (1) tab modal (2) or window modal(3) by default
18041800
// This is a fallback value for when prompt callers do not specify a modalType.
18051801
pref("prompts.defaultModalType", 3);

browser/components/customizableui/CustomizableUI.sys.mjs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -594,14 +594,6 @@ var CustomizableUIInternal = {
594594
defaultPlacements.splice(-1, 0, "developer-button");
595595
}
596596

597-
let showCharacterEncoding = Services.prefs.getComplexValue(
598-
"browser.menu.showCharacterEncoding",
599-
Ci.nsIPrefLocalizedString
600-
).data;
601-
if (showCharacterEncoding == "true") {
602-
defaultPlacements.push("characterencoding-button");
603-
}
604-
605597
savedPanelPlacements = savedPanelPlacements.filter(
606598
id => !defaultPlacements.includes(id)
607599
);

browser/locales/en-US/chrome/browser/browser.properties

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,6 @@ troubleshootModeRestartPromptTitle=Restart %S in Troubleshoot Mode?
246246
troubleshootModeRestartPromptMessage=Your extensions, themes, and custom settings will be temporarily disabled.
247247
troubleshootModeRestartButton=Restart
248248

249-
# LOCALIZATION NOTE (browser.menu.showCharacterEncoding): Set to the string
250-
# "true" (spelled and capitalized exactly that way) to show the "Text
251-
# Encoding" menu in the main Firefox button on Windows. Any other value will
252-
# hide it. Regardless of the value of this setting, the "Text Encoding"
253-
# menu will always be accessible via the "Browser Tools" menu.
254-
# This is not a string to translate; it just controls whether the menu shows
255-
# up in the Firefox button. If users frequently use the "Text Encoding"
256-
# menu, set this to "true". Otherwise, you can leave it as "false".
257-
browser.menu.showCharacterEncoding=false
258-
259249
# Process hang reporter
260250
# LOCALIZATION NOTE (processHang.selected_tab.label): %1$S is the name of the product (e.g., Firefox)
261251
processHang.selected_tab.label = This page is slowing down %1$S. To speed up your browser, stop this page.

testing/marionette/harness/marionette_harness/tests/unit/test_prefs.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,31 @@ def test_get_set_pref_default_branch(self):
100100
self.assertEqual(self.marionette.get_pref(pref_default), "default_value")
101101

102102
def test_get_pref_value_type(self):
103-
# Without a given value type the properties URL will be returned only
104-
pref_complex = "browser.menu.showCharacterEncoding"
105-
properties_file = "chrome://browser/locale/browser.properties"
103+
pref_complex = "marionette.test.complex"
104+
105+
# Set a nsIFile complex preference pointing to a temporary folder.
106+
with self.marionette.using_context(self.marionette.CONTEXT_CHROME):
107+
expected_path = self.marionette.execute_script(
108+
"""
109+
let pref = arguments[0];
110+
let tempDir = Services.dirsvc.get("TmpD", Ci.nsIFile);
111+
Services.prefs.setComplexValue(pref, Ci.nsIFile, tempDir);
112+
return tempDir.path;
113+
""",
114+
script_args=(pref_complex,),
115+
)
116+
117+
# Read the complex preference without a value_type,
118+
# the path as a string should be returned.
106119
self.assertEqual(
107-
self.marionette.get_pref(pref_complex, default_branch=True), properties_file
120+
self.marionette.get_pref(pref_complex, default_branch=False), expected_path
108121
)
109122

110123
# Otherwise the property named like the pref will be translated
111124
value = self.marionette.get_pref(
112-
pref_complex, default_branch=True, value_type="nsIPrefLocalizedString"
125+
pref_complex, default_branch=False, value_type="nsIFile"
113126
)
114-
self.assertNotEqual(value, properties_file)
127+
self.assertNotEqual(value, expected_path)
115128

116129
def test_set_prefs(self):
117130
# By default none of the preferences are set

0 commit comments

Comments
 (0)