Bookmark All Tabs on Exit

Is there an add-on that will save all tabs on exiting Firefox as a Bookmark? One can tag all tabs then save them as a Bookmark, manually. Am looking for anything that will do this automatically on exit.

This may not be possible.
You can detect that the last window is being closed, but at this time the whole browser is in the process of shutting down and modifying bookmarks (which is asynchronous IO operation) at this point may/will fail.

And even if it didn’t fail, it would for sure not synchronize with other devices so you would not see your closed tabs on a different device (if that’s what you are after).

This use-case (to see tabs on other devices) is actually what I’ve been looking for long ago and I’ve implemented addon for that - the Tab Sync Pro. But it’s in the maintenance mode now and I don’t plan future updates.

The extension could use tabs.onCreated / tabs.onRemoved to keep a list of open tabs in storage.local
When the user restarts the browser, it creates a bookmark with these tabs.
Would that work?

Yes, that would work. But would that be useful? :slight_smile:
I’m guessing that the point here is to be able to see what tabs are opened on a different device (for example at work from your home).

I’ve been asking myself the same question :upside_down_face:

Maybe this is what OP actually wants?
https://support.mozilla.org/en-US/kb/restore-previous-session#w_when-youve-set-firefox-to-restore-the-previous-session-at-startup

1 Like

Ah, thankx all for ringing in on my OP. The reason for asking about this kind of function is… twice in the last few days I got nailed by exiting Firefox only to find a secondary window had been opened, so when I fired up FF the next day, it brought back the tab session on shutdown, as I had set it to do… and of course only the single Tab/Windows returned.

I went to history and usually can resurrect the past windows. In this particular session tho, I’d carried a tab over for a couple of days and where I almost always bookmark saveable tabs, I didn’t on this one. As it was also carried over for several days, it was buried in History and ended up not finding it. Blah blah… my fault.

But having been nailed twice in a few days, yep, I should ensure I don’t have a dangling tab/window, usually do, and bookmark bookmark bookmark.

All sensible solutions. Still, I mused about… wouldn’t it be nifty if, if there was a function that provided the ability to save all sessions/tabs/windows on exit, bookmarking them with a date/time stamp. I would personally find this functionality useful. And totally understand if responses come back saying “bookmark important links ffs”. Yeah, that is the solution. But figure can’t hurt to ask if there was such a function.

And there are pitfalls in closing a FF session anywayz… so… is worth exploring at least. I appreciate the replies exploring the idea tho. Created a minor buzz, where creative mind commingle. A good thing.

There is one way to prevent this - always close Firefox using main menu / Exit (that way the whole session will be saved).

That’s what I do since I always have multiple windows opened across monitors, and it works great.

Alternatively I could also recommend using Sleep / Hibernation instead of Shut down. That way you don’t have to turn off any programs and yet the PC is OFF (well, it sleeps or hibernates).

That’s exactly the problem I have. As you said, one should always close the main window last, but every so often after an exhausting day I simply forget that I opened an auxiliary window 5 hours ago…
I would like to dive into add-on development and think this is something I could start with. Are there any more experienced people willing to help out or point me in the right direction?

@Filler, I’m happy to answer questions here and in the Add-ons Matrix room. :slight_smile: