Loading browser/components/newidentity/content/newidentity.js +12 −13 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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(); Loading Loading
browser/components/newidentity/content/newidentity.js +12 −13 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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(); Loading