This has become more of an issue since I got a Magic Mouse and have middle-click mapped as 3-finger touch. It's always annoyed me that Firefox even does this--is there a way to prevent firefox from closing tabs when you middle-click them?
As there doesn't appear to be a setting in about:config, the only way i know how to do it is using the addon Tab Mix Plus: https://addons.mozilla.org/en-US/firefox/addon/1122
It is a system setting not Firefox. You can check on the file explorer.
On Ubuntu 18 gnome :
gnome-tweaks > Windows > Titlebar Actions > Middle-Click > select Toggle Maximize
On other system :
gsettings command line here: https://askubuntu.com/a/655648/360110