author | Dão Gottwald <dao@mozilla.com> |
Tue, 22 Oct 2019 07:22:55 +0000 (2019-10-22) | |
changeset 498489 | bc06b3f5a1f9c99ce3a132b286d64b9db975b897 |
parent 498488 | 84ecc410ce655ff6a657164ae62027e242836463 |
child 498490 | e7bb97bf40c1b6999db1f973a5267c1aab1d79e4 |
push id | 36719 |
push user | ncsoregi@mozilla.com |
push date | Tue, 22 Oct 2019 15:53:00 +0000 (2019-10-22) |
treeherder | mozilla-central@a8089b1fa5c4 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mak |
bugs | 1589923 |
milestone | 72.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -327,18 +327,20 @@ pref("browser.urlbar.openintab", false); // This is disabled until Bug 1340663 figures out the remaining requirements. pref("browser.urlbar.usepreloadedtopurls.enabled", false); pref("browser.urlbar.usepreloadedtopurls.expire_days", 14); // Whether the quantum bar displays the major design update. #ifdef NIGHTLY_BUILD pref("browser.urlbar.megabar", true); + pref("browser.urlbar.view.stripHttps", true); #else pref("browser.urlbar.megabar", false); + pref("browser.urlbar.view.stripHttps", false); #endif pref("browser.urlbar.openViewOnFocus", false); pref("browser.urlbar.eventTelemetry.enabled", false); pref("browser.altClickSave", false); // Enable logging downloads operations to the Console.
--- a/browser/components/extensions/test/xpcshell/test_ext_urlbar.js +++ b/browser/components/extensions/test/xpcshell/test_ext_urlbar.js @@ -296,28 +296,32 @@ add_task(async function test_onProviderR { type: UrlbarUtils.RESULT_TYPE.REMOTE_TAB, source: UrlbarUtils.RESULT_SOURCE.TABS, title: "Test remote_tab-tabs result", heuristic: false, payload: { title: "Test remote_tab-tabs result", url: "http://example.com/remote_tab-tabs", - displayUrl: "example.com/remote_tab-tabs", + displayUrl: + (UrlbarPrefs.get("view.stripHttps") ? "http://" : "") + + "example.com/remote_tab-tabs", }, }, { type: UrlbarUtils.RESULT_TYPE.TAB_SWITCH, source: UrlbarUtils.RESULT_SOURCE.TABS, title: "Test tab-tabs result", heuristic: false, payload: { title: "Test tab-tabs result", url: "http://example.com/tab-tabs", - displayUrl: "example.com/tab-tabs", + displayUrl: + (UrlbarPrefs.get("view.stripHttps") ? "http://" : "") + + "example.com/tab-tabs", }, }, { type: UrlbarUtils.RESULT_TYPE.TIP, source: UrlbarUtils.RESULT_SOURCE.OTHER_LOCAL, title: "", heuristic: false, payload: { @@ -330,17 +334,19 @@ add_task(async function test_onProviderR { type: UrlbarUtils.RESULT_TYPE.URL, source: UrlbarUtils.RESULT_SOURCE.HISTORY, title: "Test url-history result", heuristic: false, payload: { title: "Test url-history result", url: "http://example.com/url-history", - displayUrl: "example.com/url-history", + displayUrl: + (UrlbarPrefs.get("view.stripHttps") ? "http://" : "") + + "example.com/url-history", }, }, ]; Assert.ok(context.results.every(r => r.suggestedIndex == -1)); let actualResults = context.results.map(r => ({ type: r.type, source: r.source,
--- a/browser/components/urlbar/UrlbarPrefs.jsm +++ b/browser/components/urlbar/UrlbarPrefs.jsm @@ -144,16 +144,19 @@ const PREF_URLBAR_DEFAULTS = new Map([ // After this many days from the profile creation date, the built-in set of // 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], + + // If true, we strip https:// instead of http:// from URLs in the results view. + ["view.stripHttps", false], ]); const PREF_OTHER_DEFAULTS = new Map([ ["keyword.enabled", true], ["browser.search.suggest.enabled", true], ["browser.search.suggest.enabled.private", false], ["ui.popup.disable_autohide", false], ["browser.fixup.dns_first_for_single_words", false], ]);
--- a/browser/components/urlbar/UrlbarResult.jsm +++ b/browser/components/urlbar/UrlbarResult.jsm @@ -195,18 +195,24 @@ class UrlbarResult { payloadInfo.title[0] = new URL(payloadInfo.url[0]).host; } catch (e) {} } if (payloadInfo.url) { // For display purposes we need to unescape the url. payloadInfo.displayUrl = [...payloadInfo.url]; let url = payloadInfo.displayUrl[0]; - if (UrlbarPrefs.get("trimURLs")) { - url = BrowserUtils.trimURL(url || ""); + if (url && UrlbarPrefs.get("trimURLs")) { + if (UrlbarPrefs.get("view.stripHttps")) { + if (url.startsWith("https://")) { + url = url.substring(8); + } + } else { + url = BrowserUtils.trimURL(url); + } } payloadInfo.displayUrl[0] = Services.textToSubURI.unEscapeURIForUI( "UTF-8", url ); } // For performance reasons limit excessive string lengths, to reduce the
--- a/browser/components/urlbar/tests/browser/browser_urlbarDecode.js +++ b/browser/components/urlbar/tests/browser/browser_urlbarDecode.js @@ -84,17 +84,19 @@ add_task(async function test_resultsDisp await PlacesTestUtils.addVisits("http://example.com/%E9%A1%B5"); await promiseAutocompleteResultPopup("example"); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); Assert.equal( result.displayed.url, - "example.com/\u9875", + UrlbarPrefs.get("view.stripHttps") + ? "http://example.com/\u9875" + : "example.com/\u9875", "Should be displayed the correctly unescaped URL" ); }); async function checkInput(inputStr) { await promiseAutocompleteResultPopup(inputStr); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
--- a/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js +++ b/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js @@ -82,27 +82,33 @@ function assertDisplayedHighlights(eleme } } add_task(async function test_url_result() { await testResult( { query: "\u6e2C\u8a66", title: "The \u6e2C\u8a66 URL", - url: "http://example.com/\u6e2C\u8a66test", + url: "https://example.com/\u6e2C\u8a66test", }, { - displayedUrl: "example.com/\u6e2C\u8a66test", + displayedUrl: + (UrlbarPrefs.get("view.stripHttps") ? "" : "https://") + + "example.com/\u6e2C\u8a66test", highlightedTitle: [ ["The ", false], ["\u6e2C\u8a66", true], [" URL", false], ], highlightedUrl: [ - ["example.com/", false], + [ + (UrlbarPrefs.get("view.stripHttps") ? "" : "https://") + + "example.com/", + false, + ], ["\u6e2C\u8a66", true], ["test", false], ], } ); }); add_task(async function test_url_result_no_trimming() { @@ -132,17 +138,19 @@ add_task(async function test_url_result_ Services.prefs.clearUserPref("browser.urlbar.trimURLs"); }); add_task(async function test_case_insensitive_highlights_1() { await testResult( { query: "exam", title: "The examPLE URL EXAMple", - url: "http://example.com/ExAm", + url: + (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + "://example.com/ExAm", }, { displayedUrl: "example.com/ExAm", highlightedTitle: [ ["The ", false], ["exam", true], ["PLE URL ", false], ["EXAM", true], @@ -153,17 +161,19 @@ add_task(async function test_case_insens ); }); add_task(async function test_case_insensitive_highlights_2() { await testResult( { query: "EXAM", title: "The examPLE URL EXAMple", - url: "http://example.com/ExAm", + url: + (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + "://example.com/ExAm", }, { displayedUrl: "example.com/ExAm", highlightedTitle: [ ["The ", false], ["exam", true], ["PLE URL ", false], ["EXAM", true], @@ -174,17 +184,19 @@ add_task(async function test_case_insens ); }); add_task(async function test_case_insensitive_highlights_3() { await testResult( { query: "eXaM", title: "The examPLE URL EXAMple", - url: "http://example.com/ExAm", + url: + (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + "://example.com/ExAm", }, { displayedUrl: "example.com/ExAm", highlightedTitle: [ ["The ", false], ["exam", true], ["PLE URL ", false], ["EXAM", true], @@ -195,17 +207,19 @@ add_task(async function test_case_insens ); }); add_task(async function test_case_insensitive_highlights_4() { await testResult( { query: "ExAm", title: "The examPLE URL EXAMple", - url: "http://example.com/ExAm", + url: + (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + "://example.com/ExAm", }, { displayedUrl: "example.com/ExAm", highlightedTitle: [ ["The ", false], ["exam", true], ["PLE URL ", false], ["EXAM", true], @@ -216,17 +230,19 @@ add_task(async function test_case_insens ); }); add_task(async function test_case_insensitive_highlights_5() { await testResult( { query: "exam foo", title: "The examPLE URL foo EXAMple FOO", - url: "http://example.com/ExAm/fOo", + url: + (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + "://example.com/ExAm/fOo", }, { displayedUrl: "example.com/ExAm/fOo", highlightedTitle: [ ["The ", false], ["exam", true], ["PLE URL ", false], ["foo", true], @@ -246,17 +262,19 @@ add_task(async function test_case_insens ); }); add_task(async function test_case_insensitive_highlights_6() { await testResult( { query: "EXAM FOO", title: "The examPLE URL foo EXAMple FOO", - url: "http://example.com/ExAm/fOo", + url: + (UrlbarPrefs.get("view.stripHttps") ? "https" : "http") + + "://example.com/ExAm/fOo", }, { displayedUrl: "example.com/ExAm/fOo", highlightedTitle: [ ["The ", false], ["exam", true], ["PLE URL ", false], ["foo", true],