fix: use url.toString()
This commit is contained in:
parent
59cadac430
commit
02c2a59938
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue