Skip to content
Snippets Groups Projects
Commit 24d6492f authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern: Committed by morgan
Browse files

Bug 42773: Replace ~ with the original home.

In Bug 93141, Mozilla started sending users to their home when they type
~ in the URL bar.
On Linux, we change $HOME for various reason, therefore you would be
redirected to the spoofed home directory when typing ~.
So, we check if the original home directory is known, and use that,
instead.
parent 0ad10ba1
No related branches found
No related tags found
No related merge requests found
Pipeline #200975 passed
......@@ -934,6 +934,10 @@ function fileURIFixup(uriString) {
} else {
// UNIX: Check if it starts with "/" or "~".
attemptFixup = /^[~/]/.test(uriString);
const originalHome = Services.env.get("BB_ORIGINAL_HOME");
if (originalHome && (uriString === "~" || uriString.startsWith("~/"))) {
path = originalHome + path.substring(1);
}
}
if (attemptFixup) {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment