make url bar update on navigate

This commit is contained in:
CoolElectronics 2023-08-12 18:13:14 -04:00
parent 099b191981
commit 2f666df2ed
No known key found for this signature in database
GPG key ID: F63593D168636C50

View file

@ -139,6 +139,13 @@
);
}
}
function frameLoad() {
if (!import.meta.env.VITE_ADRIFT_SINGLEFILE) {
url = __uv$config.decodeUrl(
proxyIframe.contentDocument?.location.href.replace(/.*\//g, "")
);
}
}
</script>
{#if ready}
@ -147,7 +154,7 @@
<input bind:value={url} type="text" />
<button on:click={() => visitURL(url)}>Go!</button>
</div>
<iframe class="h-full w-full" bind:this={proxyIframe} />
<iframe class="h-full w-full" bind:this={proxyIframe} on:load={frameLoad} />
</div>
{:else if !import.meta.env.VITE_ADRIFT_DEV}
<div class="container">