How to save a tab's memory state in Firefox/Chrome?

4.7k views Asked by At

I want to be able to save a tab's state in Firefox or Google Chrome so that I can restore it later, through writing a custom add-on/plug-in/extension.

The closest thing I can find is Firefox's session store API, which can save form data and scroll position. However, I want to save Javascript state too. In addition, if possible, I want to be able to restore the page even if the website is no longer available. It would be the best if there a way to save all the parsed resource/data structure.

Is it possible for any of the major browsers?

2

There are 2 answers

2
Scott Swanson On

Try using Session Buddy: https://chrome.google.com/webstore/detail/session-buddy/edacconmaakjimmfgnblocblbcdcpbko. I've been using it for a while now, and it does exactly what you're talking about and more.

1
Alexander Pavlov On

Just serialize everything you need to restore your page state into a localStorage (it is persistent, unlike sessionStorage) and invoke a respective deserialization function in your page's DOMContentLoaded (or load) event handler.