I'm using pushStates in my ajax-app to navigate from one "page" to another. Now, I'd like to see from what page I was coming from. But document.referrer
always returns ""
. Or, when I open my app from another page (where it is linked), I got the URL from that other page.
Shouldn't these lines...
history.pushState({}, "Some title", "/some/valid/url/1");
history.pushState({}, "Some title", "/some/valid/url/2");
...produce a referrer like this:
http://somedomain.com/some/valid/url/1
?
Or in other words: Is there any way to set the document.referrer
accordingly, or at least reset it to ""
?
Note: I'm looking for solutions without caching the previous URL in some variable. I need something that really changes the document.referrer
, because I cannot change the scripts that rely on it.