diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index f639df02762a..7e423a3d4c26 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -324,13 +324,15 @@ pref("browser.urlbar.openintab", false); pref("browser.urlbar.usepreloadedtopurls.enabled", false); pref("browser.urlbar.usepreloadedtopurls.expire_days", 14); -// Whether the quantum bar displays the major design update. -pref("browser.urlbar.megabar", false); -// Whether we expand the font size when the megabar is focused. -pref("browser.urlbar.megabar.expandTextOnFocus", false); -// Whether the megabar displays the permanent search icon. -pref("browser.urlbar.searchIcon", false); -pref("browser.urlbar.view.stripHttps", false); +// Whether the quantum bar displays design update 1. +pref("browser.urlbar.update1", false); +// Whether we expand the font size when when the urlbar is +// focused in design update 1. +pref("browser.urlbar.update1.expandTextOnFocus", false); +// Whether the urlbar displays a permanent search button in design update 1. +pref("browser.urlbar.update1.searchButton", false); +// Whether the urlbar should strip https from urls in the view. +pref("browser.urlbar.update1.view.stripHttps", false); pref("browser.urlbar.openViewOnFocus", false); pref("browser.urlbar.eventTelemetry.enabled", false); diff --git a/browser/components/extensions/test/xpcshell/test_ext_urlbar.js b/browser/components/extensions/test/xpcshell/test_ext_urlbar.js index 701acf8aed53..d21eb208918d 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_urlbar.js +++ b/browser/components/extensions/test/xpcshell/test_ext_urlbar.js @@ -290,7 +290,7 @@ add_task(async function test_onProviderResultsRequested() { title: "Test remote_tab-tabs result", url: "http://example.com/remote_tab-tabs", displayUrl: - (UrlbarPrefs.get("view.stripHttps") ? "http://" : "") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "http://" : "") + "example.com/remote_tab-tabs", }, }, @@ -303,7 +303,7 @@ add_task(async function test_onProviderResultsRequested() { title: "Test tab-tabs result", url: "http://example.com/tab-tabs", displayUrl: - (UrlbarPrefs.get("view.stripHttps") ? "http://" : "") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "http://" : "") + "example.com/tab-tabs", }, }, @@ -328,7 +328,7 @@ add_task(async function test_onProviderResultsRequested() { title: "Test url-history result", url: "http://example.com/url-history", displayUrl: - (UrlbarPrefs.get("view.stripHttps") ? "http://" : "") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "http://" : "") + "example.com/url-history", }, }, diff --git a/browser/components/urlbar/UrlbarInput.jsm b/browser/components/urlbar/UrlbarInput.jsm index 4f5af723789f..58b331e10e03 100644 --- a/browser/components/urlbar/UrlbarInput.jsm +++ b/browser/components/urlbar/UrlbarInput.jsm @@ -82,11 +82,12 @@ class UrlbarInput { ); this.panel = this.textbox.querySelector(".urlbarView"); - this.megabar = UrlbarPrefs.get("megabar"); + // "Megabar" is the internal codename for the update1 design refresh. + this.megabar = UrlbarPrefs.get("update1"); if (this.megabar) { this.textbox.classList.add("megabar"); this.textbox.parentNode.classList.add("megabar"); - this.searchIcon = UrlbarPrefs.get("searchIcon"); + this.searchIcon = UrlbarPrefs.get("update1.searchButton"); if (this.searchIcon) { this.textbox.classList.add("searchIcon"); } diff --git a/browser/components/urlbar/UrlbarPrefs.jsm b/browser/components/urlbar/UrlbarPrefs.jsm index 42c3cf9a4952..c813f2d090c0 100644 --- a/browser/components/urlbar/UrlbarPrefs.jsm +++ b/browser/components/urlbar/UrlbarPrefs.jsm @@ -103,12 +103,6 @@ const PREF_URLBAR_DEFAULTS = new Map([ // The maximum number of results in the urlbar popup. ["maxRichResults", 10], - // Whether the quantum bar displays the major design update. - ["megabar", false], - - // Whether the megabar displays the permanent search icon. - ["searchIcon", false], - // One-off search buttons enabled status. ["oneOffSearches", false], @@ -119,6 +113,11 @@ const PREF_URLBAR_DEFAULTS = new Map([ // Whether to open the urlbar view when the input field is focused by the user. ["openViewOnFocus", false], + // When true, URLs in the user's history that look like search result pages + // are styled to look like search engine results instead of the usual history + // results. + ["restyleSearches", false], + // Whether speculative connections should be enabled. ["speculativeConnect.enabled", true], @@ -148,13 +147,14 @@ const PREF_URLBAR_DEFAULTS = new Map([ // popular domains will no longer be included in the results. ["usepreloadedtopurls.expire_days", 14], - // When true, URLs in the user's history that look like search result pages - // are styled to look like search engine results instead of the usual history - // results. - ["restyleSearches", false], + // Whether the quantum bar displays design update 1. + ["update1", false], + + // Whether the urlbar displays a permanent search button in design update 1. + ["update1.searchButton", false], // If true, we strip https:// instead of http:// from URLs in the results view. - ["view.stripHttps", false], + ["update1.view.stripHttps", false], ]); const PREF_OTHER_DEFAULTS = new Map([ ["keyword.enabled", true], diff --git a/browser/components/urlbar/UrlbarResult.jsm b/browser/components/urlbar/UrlbarResult.jsm index 47b154c019c6..5b52c6353a9b 100644 --- a/browser/components/urlbar/UrlbarResult.jsm +++ b/browser/components/urlbar/UrlbarResult.jsm @@ -201,7 +201,7 @@ class UrlbarResult { payloadInfo.displayUrl = [...payloadInfo.url]; let url = payloadInfo.displayUrl[0]; if (url && UrlbarPrefs.get("trimURLs")) { - if (UrlbarPrefs.get("view.stripHttps")) { + if (UrlbarPrefs.get("update1.view.stripHttps")) { url = BrowserUtils.removeSingleTrailingSlashFromURL(url); if (url.startsWith("https://")) { url = url.substring(8); diff --git a/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js b/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js index d109688745be..f87eb06c5b94 100644 --- a/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js +++ b/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js @@ -53,7 +53,7 @@ async function checkDoesNotOpenOnFocus(win = window) { add_task(async function setup() { await SpecialPowers.pushPrefEnv({ - set: [["browser.urlbar.megabar", true]], + set: [["browser.urlbar.update1", true]], }); // Add some history for the empty panel. await PlacesTestUtils.addVisits([ diff --git a/browser/components/urlbar/tests/browser/browser_urlbarDecode.js b/browser/components/urlbar/tests/browser/browser_urlbarDecode.js index e69acba25ab1..21f39a152c1e 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbarDecode.js +++ b/browser/components/urlbar/tests/browser/browser_urlbarDecode.js @@ -88,7 +88,7 @@ add_task(async function test_resultsDisplayDecoded() { let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); Assert.equal( result.displayed.url, - UrlbarPrefs.get("view.stripHttps") + UrlbarPrefs.get("update1.view.stripHttps") ? "http://example.com/\u9875" : "example.com/\u9875", "Should be displayed the correctly unescaped URL" diff --git a/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js b/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js index 2ba6dc60bf2e..b8144cb78069 100644 --- a/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js +++ b/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js @@ -91,7 +91,7 @@ add_task(async function test_url_result() { }, { displayedUrl: - (UrlbarPrefs.get("view.stripHttps") ? "" : "https://") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "" : "https://") + "example.com/\u6e2C\u8a66test", highlightedTitle: [ ["The ", false], @@ -100,7 +100,7 @@ add_task(async function test_url_result() { ], highlightedUrl: [ [ - (UrlbarPrefs.get("view.stripHttps") ? "" : "https://") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "" : "https://") + "example.com/", false, ], @@ -120,10 +120,14 @@ add_task(async function test_url_result_no_path() { }, { displayedUrl: - (UrlbarPrefs.get("view.stripHttps") ? "" : "https://") + "example.com", + (UrlbarPrefs.get("update1.view.stripHttps") ? "" : "https://") + + "example.com", highlightedTitle: [["The Title", false]], highlightedUrl: [ - [(UrlbarPrefs.get("view.stripHttps") ? "" : "https://") + "ex", false], + [ + (UrlbarPrefs.get("update1.view.stripHttps") ? "" : "https://") + "ex", + false, + ], ["ample", true], [".com", false], ], @@ -164,7 +168,7 @@ add_task(async function test_case_insensitive_highlights_1() { query: "exam", title: "The examPLE URL EXAMple", url: - (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") + "://example.com/ExAm", }, { @@ -187,7 +191,7 @@ add_task(async function test_case_insensitive_highlights_2() { query: "EXAM", title: "The examPLE URL EXAMple", url: - (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") + "://example.com/ExAm", }, { @@ -210,7 +214,7 @@ add_task(async function test_case_insensitive_highlights_3() { query: "eXaM", title: "The examPLE URL EXAMple", url: - (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") + "://example.com/ExAm", }, { @@ -233,7 +237,7 @@ add_task(async function test_case_insensitive_highlights_4() { query: "ExAm", title: "The examPLE URL EXAMple", url: - (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") + "://example.com/ExAm", }, { @@ -256,7 +260,7 @@ add_task(async function test_case_insensitive_highlights_5() { query: "exam foo", title: "The examPLE URL foo EXAMple FOO", url: - (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") + "://example.com/ExAm/fOo", }, { @@ -288,7 +292,7 @@ add_task(async function test_case_insensitive_highlights_6() { query: "EXAM FOO", title: "The examPLE URL foo EXAMple FOO", url: - (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + (UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") + "://example.com/ExAm/fOo", }, { diff --git a/browser/themes/linux/browser.css b/browser/themes/linux/browser.css index 0c81153c73b4..446a53feb29a 100644 --- a/browser/themes/linux/browser.css +++ b/browser/themes/linux/browser.css @@ -281,7 +281,7 @@ notification[value="translation"] menulist > .menulist-dropmarker { font-size: 1.05em; } -@supports -moz-bool-pref("browser.urlbar.megabar.expandTextOnFocus") { +@supports -moz-bool-pref("browser.urlbar.update1.expandTextOnFocus") { .urlbarView { font-size: inherit; } diff --git a/browser/themes/osx/browser.css b/browser/themes/osx/browser.css index ff3ac3df381c..c1f924ceb69e 100644 --- a/browser/themes/osx/browser.css +++ b/browser/themes/osx/browser.css @@ -300,7 +300,7 @@ font-size: 14px; } -@supports -moz-bool-pref("browser.urlbar.megabar.expandTextOnFocus") { +@supports -moz-bool-pref("browser.urlbar.update1.expandTextOnFocus") { .urlbarView { font-size: inherit; } diff --git a/browser/themes/windows/browser.css b/browser/themes/windows/browser.css index b03b43a4962a..3ec85970581f 100644 --- a/browser/themes/windows/browser.css +++ b/browser/themes/windows/browser.css @@ -554,7 +554,7 @@ menuitem.bookmark-item { } } -@supports -moz-bool-pref("browser.urlbar.megabar.expandTextOnFocus") { +@supports -moz-bool-pref("browser.urlbar.update1.expandTextOnFocus") { #urlbar[breakout-extend] { font-size: 1.25em; }