Commit 1f509f30 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by clairehurst
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 cd7623ae
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -924,6 +924,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 {