I am posting this here because it only happens in Linux. I think I have first seen this when I have started using Linux, almost 10 years now. I was already fond of Firefox and still am. I want to keep using Firefox as my default browser but this makes it difficult.
Downloaded files can be double-clicked/opened in the downloads list and they should open in the application set at system level or at least in one that makes sense. What about jpeg files downloaded with Firefox opening in Vivaldi browser? Or deb files opening in Ark archiver? 'Show in folder' opened Qmmp player or Audacious at some point.
I know I can (and did) edit/customize ~/.local/share/Applications/defaults.list, ~/.local/share/Applications/mimeapps.list, /.local/share/Applications/mimeinfo.cache and what not, but I'm tired of that.
In Firefox Settings, Applications, the problematic files have the "Always ask" option. Vivaldi appears as the "default", though. Why did that happen, and why only Firefox thinks Vivaldi is default for jpeg, while Chrome and other browsers use the expected image viewer? Why is it only happening in Firefox and in Linux?
What is the basic cause?
(At some point I blamed the various programs and their possible aggressive policy of imposing themselves or decoying as default programs. But how come only Firefox is tricked into falling for that?)
Can this problem be prevented?
A quick solution is to uninstall the false "default" program; less quickly, I can manually edit files with hundreds of lines. The problem usually involves a recently installed program. A "fix" could be to install a new one and have that as "default", however odd. Or remove and re-install the correct program! — But I want to prevent such "solutions".
I hope for something like a setting in about:config, saying "use system file associations", which once enabled would ignore the options in Settings/General/Applications or make them copy the ones at system level.
Not only a Firefox setting that can be altered by other programs is rather pointless, but the setting is not even respected; Vivaldi was also opening pdf files; removing Vivaldi and selecting "System default application", a pdf file is opened in ...Chrome! Changing that to —well!— Okular, the same happens...
EDIT:
This question is about how to avoid a situation where Firefox opens its downloaded files in unexpected programs. On what files/settings can be edited to fix that problem: see this question.