Get current URL
Via SveletKit stores
page is a readable store whose value reflects the object passed to load functions — it contains
query. See the page section page | Docs • SvelteKit - https://kit.svelte.dev/docs#loading-input-page above for more details.
Suppose the current URL is
https://example.com/page/, in the above example.
In that case,
$page.path will return
If you want the full URL, you can prepend
window.location.origin (once the component has mounted).
In the above example, the URL is not reactive, but it will return the complete URL rather than just the current page.
So if the current URL is
https://example.com/page/, url will return
https://example.com/page/, because it is simply grabbing