Skip to content
Snippets Groups Projects
Commit 1f3d2079 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern: Committed by Beatriz Rizental
Browse files

BB 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 a2d78ef1
Branches
Tags
1 merge request!1527Bug 43808: Rebase 128.10.1 onto 128.11
......@@ -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.
Please to comment