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:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /browser/components/urlbar/tests/UrlbarTestUtils.sys.mjs
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/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;
},