How should the state of a page be saved?
For example, consider the user is browsing through all kinds of webpages, some of them probably coded like this:
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);
};
<div id=d style=background:skyblue;></div>
<!-- click Run ↓ -->
I'd like to save the current states of selected tabs (the entire tab session) and resume them at a future time.
What are some techniques to do this?
(This should 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.)