Commit 64bcf3cf authored by brizental's avatar brizental
Browse files

fixup! BB 40926: Implemented the New Identity feature

parent 673df9af
Loading
Loading
Loading
Loading
+12 −13
Original line number Diff line number Diff line
@@ -418,10 +418,13 @@ ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => {
            tbl.onLocationChange = (...args) => {
              tbl.onLocationChange = onLocationChange;
              tbl.onLocationChange(...args);
              let displayAddress;
              try {
                const url = new URL(homeURL);
                displayAddress = url.hostname;
              const url = URL.parse(homeURL);
              if (!url) {
                // malformed URL, bail out
                return;
              }

              let displayAddress = url.hostname;
              if (!displayAddress) {
                // no host, use full address and truncate if too long
                const MAX_LEN = 32;
@@ -430,10 +433,6 @@ ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => {
                  displayAddress = `${displayAddress.substring(0, MAX_LEN)}…`;
                }
              }
              } catch (e) {
                // malformed URL, bail out
                return;
              }
              const callback = () => {
                Services.prefs.setStringPref(trustedHomePref, homeURL);
                win.BrowserHome();