I use pushStates in my ajax application to navigate from one page to another. Now I would like to see which page I came from. But document.referrer always returns "" . Or, when I open the application from another page (where it is connected), I got the URL from this other page.
Shouldn't these lines ...
history.pushState({}, "Some title", "/some/valid/url/1");
history.pushState({}, "Some title", "/some/valid/url/2");
... create a referrer as follows:
http://somedomain.com/some/valid/url/1
?
Or, in other words: is there a way to set document.referrer accordingly, or at least reset to "" ?
Note. I am looking for solutions without caching the previous URL in some variable. I need something that really modifies document.referrer , because I cannot change the scripts that rely on it.
html5 pushstate
kraftwer1
source share