From a90a5cba08fdf6c0ceb95101c275108a152a3aed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:37 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs') diff --git a/browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs b/browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs index f576f4ca19..793af24b41 100644 --- a/browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs +++ b/browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs @@ -1043,9 +1043,11 @@ export var UrlbarTestUtils = { * Removes the scheme from an url according to user prefs. * * @param {string} url - * The url that is supposed to be sanitizied. - * @param {{removeSingleTrailingSlash: (boolean)}} options - * removeSingleTrailingSlash: Remove trailing slash, when trimming enabled. + * The url that is supposed to be trimmed. + * @param {object} [options] + * Options for the trimming. + * @param {boolean} [options.removeSingleTrailingSlash] + * Remove trailing slash, when trimming enabled. * @returns {string} * The sanitized URL. */ @@ -1060,15 +1062,13 @@ export var UrlbarTestUtils = { lazy.BrowserUIUtils.removeSingleTrailingSlashFromURL(sanitizedURL); } + // Also remove emphasis markers if present. if (lazy.UrlbarPrefs.get("trimHttps")) { - sanitizedURL = sanitizedURL.replace("https://", ""); + sanitizedURL = sanitizedURL.replace(/^?/, ""); } else { - sanitizedURL = sanitizedURL.replace("http://", ""); + sanitizedURL = sanitizedURL.replace(/^?/, ""); } - // Remove empty emphasis markers in case the protocol was trimmed. - sanitizedURL = sanitizedURL.replace("<>", ""); - return sanitizedURL; }, -- cgit v1.2.3