No, It is Immpossible.
The best way to act is to save state in localStorage. If you use, for example. The hash URL to track your status (for example, myApp.html / # loginScreen), you can save this information and then apply it to location.hash, which will send window.onhashchange.
In other words (codes are just an example written on the fly):
1 - save the relevant information in localStorage:
localStorage.setItem("state", "loginScreen");
2 - get the value at startup and apply it to the hash:
location.hash = (localStorage.getItem("state")) ? localStorage.getItem("state") : "";
3 - associate an event listener with onhashchange and go from there:
window.addEventListener("hashchange", function() { if (location.hash.length) { alert("Current state of UI is :"+ location.hash); } }, false);
zvona source share