summaryrefslogtreecommitdiffstats
path: root/browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs')
-rw-r--r--browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs16
1 files changed, 8 insertions, 8 deletions
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(/^<?https:\/\/>?/, "");
} else {
- sanitizedURL = sanitizedURL.replace("http://", "");
+ sanitizedURL = sanitizedURL.replace(/^<?http:\/\/>?/, "");
}
- // Remove empty emphasis markers in case the protocol was trimmed.
- sanitizedURL = sanitizedURL.replace("<>", "");
-
return sanitizedURL;
},