title: How to save the full state of a webpage via Chrome extension?
body: <p>How should the state of a page be saved?</p>
  
  <p>For example, consider the user is browsing through all kinds of webpages, some of them  probably coded like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>onload=function(){
      let d_s = document.getElementById('d').style;
      d_s.width = d_s.height = Math.random() * 500 + 'px';
      setTimeout(onload, 800 + Math.random() * 800);
  };</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id=d style=background:skyblue;&gt;&lt;/div&gt;
  &lt;!-- click Run ↓ --&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'd like to save the current states of selected tabs (the entire tab <em>session</em>) and resume them at a future time.</p>
  
  <p>What are some techniques to do this?</p>
  
  <p>(This <em>should</em> be possible. After all, we can drag a tab from one Chrome window onto the next without any state change even while playing a video halfway.)</p>