fix: use url.toString()

This commit is contained in:
Derrick Hammer 2023-10-16 19:50:58 -04:00
parent 59cadac430
commit 02c2a59938
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 4 deletions

View File

@ -146,10 +146,7 @@ export function Navigator() {
// Try to parse it as a URL // Try to parse it as a URL
const url = new URL(input); const url = new URL(input);
setUrl( setUrl(url.toString() || "about:blank");
`${url.hostname}${url.pathname}${url.search}${url.hash}` ||
"about:blank",
);
} catch (e) { } catch (e) {
// Handle invalid URLs here, if needed // Handle invalid URLs here, if needed
console.error("Invalid URL:", e); console.error("Invalid URL:", e);