ItalyPaleAle / svelte-spa-router

Router for SPAs using Svelte 3
MIT License
1.53k stars 105 forks source link

How to check hash-bashed history #306

Closed Uptaker closed 1 year ago

Uptaker commented 1 year ago

As I understand, svelte-spa-router is not meant to be used with the History API, where the history state seems to always be empty in my case.

How do I programmatically check what was my previous hash-based route/url?

For example, after a push('/login'), I'd like to redirect the user back to their previous page, if that page fits the criteria.

ItalyPaleAle commented 1 year ago

This is not possible I’m afraid, as browsers do not have a history API that allows this, for privacy reasons :(