title: Save current page state javascript
body: <p>Is it possible to save the current state of a webpage so you can later restore it to that state?</p>
  
  <p>Through "state" I mean everything that defines the current behavior of the page: html tags, css, JavaScript variables, form data, etc...</p>
  
  <p>So you could simply have something like: <code>savePage()</code> which stores all the needed data in localhost and then use <code>loadPage()</code> to retrieve that data.</p>
  
  <p>I guess the <code>html</code>, <code>css</code> and <code>inputs value</code> are easy to save, but what about all the JavaScript variables on that page? Is it possible to save all the JavaScript variables held in the memory? (probably in a <code>JSON</code> object).</p>