Recover Firefox tabs after accidentally closing the window without saving the session

15,758

There are several add-ons that deal with "sessions" in Firefox. But still, if you close it and say NOT TO SAVE the session, then it's exactly what it's going to do.

I really don't see what else can be done here.

Share:
15,758
dreeves
Author by

dreeves

Startup: Beeminder.com Blog: MessyMatters.com Homepage: Dreev.es Twitter.com/dreev Favorite programming language: Mathematica Random fact: Dreeves is an ultra-marathon inline skater

Updated on June 04, 2022

Comments

  • dreeves
    dreeves almost 2 years

    I've gradually come to fully rely on Firefox's ability to recover my tabs after any kind of crash. That faith was not entirely ill-founded but what I didn't have a contingency plan for was accidentally closing the Firefox window and saying not to save the session. That just happened when my dad borrowed my laptop to check his email. Oy.

    Of course the full browser history is there but the dozens of tabs I had open are lost in a massive sea. I ran "uptime" to see the time of my last reboot and looked for a cluster of URLs all opened around that time, but either I'm missing it, or the "last visited" time doesn't work that way. In any case, I thought others might know a better way to recover the tabs, or have hacked up something to fish them out of Firefox's history or something.

    (The lesson for the future of course is to just save everything to delicious (or wherever) and not rely on your browser state! I'd also be interested to hear what systems others use to deal with this preventively.)

    ADDED: I know prima facie this seems insoluble (after all, I, or my dad, explicitly told Firefox not to save the tabs) but as an example of something that could be done (and perhaps this qualifies this question as programming related after all)...

    If Firefox stored both when the the URL was opened and when it was closed then you could extract your tabs from your history by erasing the very recent history and then fetching the URLs that were opened but never closed. So...

    The Real Question

    Does there exist an algorithm that can infer the list of open tabs based on the following inputs:

    • list of URLs and associated fields in the browser history
    • the time of the fateful dismissing of the Firefox session.

    If anyone can show that that's possible, I'll code it up and make it available as an answer here.