I shut down Firefox at night by running killall -s SIGTERM firefox via cron, in order to apply the package manager and browser addon updates. Unfortunately each time when the browser is (manually) restarted, a 'restore session' tab about:sessionrestore is opened, obviously indicating that Firefox doesn't consider this as a clean exit. I'm relying on the 'delete cookies and site data when Firefox is closed' feature (with some domain exceptions) which supposedly has the potential to misbehave when the Firefox processes are killed.
The session data in the profile folders in ~/.mozilla/firefox/ does contain some private data and bloats my backups (not necessarily easy to filter out). rsync has to some degree reported that specific files in the directory have been changed during the transfer. I rotate between several Firefox profiles on two or more workspaces and closing each manually borders on nonfeasible.
The Mozilla documentation doesn't mention any such feature. A related question about Google Chrome (/ Chromium).
Any Wayland-friendly solutions (including, potentially, Selenium and some sensible macros) are also accepted.
wmctrl) to close it as you would manually...wmctrl— I'm Wayland-only, sorry for forgetting to add the tag.ydotoolthen. It simulates input rather than interacting with the Xserver. Should be available in most standard repos.