Is there any way to list the URL's of window.history
? If I want to use window.history.go(-2)
, can you know which URL this -2 will return?
Is there any way to list the URL's of window.history
? If I want to use window.history.go(-2)
, can you know which URL this -2 will return?
There are security issues involved in the fact that every website you visit \ visited could be seen by all the other sites you've been to.
An alteration to get around this, as long as it is on your own site would use session management techniques, they are:
With normal navigations, however, it is not possible to "create / manipulate" the URLs using, the navigation in this case would be by ajax:
var estadoDoObj = { foo: "bar" }; //Estado "atual"
history.pushState(estadoDoObj, "page 2", "bar.html");
and could combine with sessionStorage
and use something with var currentState = history.state;
to get the state.
And to detect the changes use this event:
window.addEventListener("popstate", function(event) {
//...
});
I have not found anything ready, not in Github, but I will keep looking, if I do not do anything I will try to create a basic functional example (of course the application of this will depend very much on how your system is)