I’m sure you’ll get some better answers soon, but I can tell you that yes it IS possible, and pretty much always has been, but I don’t believe the answer is within Firefox itself. It’s been a long time since I did a fresh install and had to set it up, but I do remember having to make some changes in my desktop to get IT to remember the location of closed windows. In my case this was actually a change to a hidden config file and not something I could get to from any GUI settings manager, but maybe this is enough information for you to modify what you are searching for to find the answer for the desktop you are running. (My solution was for the Mate desktop, but I think Ubuntu uses Unity by default unless you selected something else?)