Detect if chrome is loading a cached page? Detect if chrome is loading a cached page? google-chrome google-chrome

Detect if chrome is loading a cached page?


Is it possible to simply store some sort of js variable that is only set true after an actual login, or does Chrome keep that stored on close as well?

A simple example to go along with my comment:

<html><head>    <script>        function DoMagic() {            document.getElementById( "magic" ).innerHTML = "<h1>Hello World!</h1>";        }    </script></head><body>    <div id="magic">Waiting for magic</div>    <br>    <input type="button" value="Do Magic" onclick="DoMagic();" /></body></html>
  • Open this in Chrome the div reads "Waiting for magic".
  • Click "Do Magic" div reads "Hello World".
  • Close Chrome by clicking X ( not the page, the browser ).
  • Open Chrome. Page loads. Div reads "Waiting for magic."

The state isn't kept between browser closes--even if the cache is. I'm thinking you can implement something similar to make sure they have to login between browser closes. Should work in all browsers too.