It's a mystery to me how Firefox updates on Ubuntu. Sometimes it goes through auto updates, but sometimes I'll try to open a new tab and it tells me that it will NOT allow me to do that until I restart. This is exceptionally annoying and not something that happens on Windows.
My reading is that if your package manager updates FF on disk while it's running, it can no longer guarantee that new tabs can be created safely, since creating a tab requires spawning a child process and the parent was created with an executable that no longer exists/knows anything about the executable it needs to use when spawning.
It is super annoying and I feel like there are some obvious fixes. I'm also not 100% sure why it only happens on Linux (it updates fine on Windows and MacOS while running right?)
Yes, but that's because it's updated by firefox itself.
If you install, say, FDE directly on linux, you'll get the same behaviour.
But if you use the distro's package manager then I don't think there's a viable workflow for it, as the package manager doesn't have hooks into process management.
The package manager would probably have to be subsumed by systemd for that to even be feasible.
You can get that behavior if you install Firefox from a tar [1], Firefox will then manage its own updates the same as on Windows (though the user running Firefox will need to have permissions to modify the files, which may be risky).
But if you install it through apt or some such package manager, the PM is doing the updates, and it doesn't take into account that Firefox is running.
More specifically, Firefox is updating itself in that situation so it knows not to do anything until startup/shutdown. When the you-have-to-restart tab appears, it's because Firefox didn't do the update, something external on linux (apt or snap or something) did it in a way Firefox can't handle.
Not an excuse but that wouldn’t work on a multi-user system of course.
The solution is to version the files and keep the old versions until the processes are closed. As Windows enforces because it doesn’t allow you to delete files that are in use.
On Windows, Firefox can't be updated while it's running because the files that comprise it are locked by the running application.
On Linux, you can delete or replace open files, and even running applications. Instead of updates being handled by dozens of individual updaters that coordinate closely with each app so that updates happen between restarts, updates happen in the background without really coordinating with running apps.
Sometimes, after Firefox has been updated, there's some kind of incompatibility between the old running binary and the new assets (internal JS, CSS, and idk what else). In that case, Firefox can't open new tabs because you're still running the old binary, which doesn't work with the new assets which have been installed, or which is looking for old assets that it opens dynamically at runtime that are simply no longer present on your disk.
> On Windows, Firefox can't be updated while it's running because the files that comprise it are locked by the running application.
I don't know how the "behind the scenes" work but you can run an update while Firefox is running. We do it all the time. We push security updates to our clients via an agent. It runs the official installer in silent mode.
It is like OP described: You can't open new tabs (ok you can but they will not work) until you restart the browser, but the existing tabs keep working.
IME Firefox does this when the OS updates packages that Firefox depends on and/or changes FF version. I can't speak to Ubuntu specifically but I've seen the same behavior on Arch and Fedora and it's always around OS updates that I've triggered manually.
Ubuntu (at least pre-snap) has Firefox in unattended-upgrades so apt can update Firefox in the background even if the user never runs updates themselves.
What is this related to?