21

Ubuntu MATE 20.04

Possible culprits:

  • Email client: Thunderbird
  • PDF reader: Atril
  • Browser: Firefox v. 104.0

None are snaps.

For years I've been getting a .pdf copy of a newspaper via links emailed to me. The emails are html formatted, and I click a field in them to download the paper.

Then a box pops up like this

enter image description here

giving me options. I always have chosen the "open with" option as shown. Then the pdf opens in the viewer and all is well.

Except, at some point in the recent past, the .pdf has also started to get downloaded and saved in the Downloads directory. (I assume in the past it went into a temp directory, but I am sure that it didn't go into Downloads).

This also happens (but did not use to) when I click a link on website to open a .pdf This probably rules out Thunderbird as the culprit, now that I come to think about it.

In the course of my I day I look at a LOT of pdfs, many of which I don't care to save (and certainly not in Downloads) so I end up with a ton of cruft in Downloads that I have to manually delete.

Does anyone know what app made this change recently, and if there is a setting somewhere to prevent it?

muru
  • 193,181
  • 53
  • 473
  • 722
Organic Marble
  • 22,803
  • 12
  • 65
  • 118

1 Answers1

25

It looks like Firefox stopped using temp directories for "open with" after version 98, because users were losing files, and they later added a config to get back this functionality: https://bugzilla.mozilla.org/show_bug.cgi?id=1738574#c133

Go to about:config and set browser.download.start_downloads_in_tmp_dir to true, and restart Firefox, and it should use temp directories for "open with". Saving files works as intended.
Note that if you are using snap package, this might cause issues with temp folders.

Cagri
  • 727
  • 7
  • 12
  • 1
    What kind of "issues with temp folders" can be expected when using the snap package? – Marijn Sep 15 '22 at 17:21
  • 1
    @Marijn for example, it doesn't download/openwith at all for me while using Firefox snap. Without this option, I couldn't save to `/tmp` with Firefox snap anyways. – Cagri Sep 15 '22 at 17:55
  • @Cagri a major reason for avoiding snaps is that their permissions are so restricted they can't work properly if at all in `/tmp`. What's unforgivably dumb about that is that the failure is either silent or cryptic, as I found out painfully slowly when `pdftk` stopped working as it should after updating my distro – Chris H Sep 16 '22 at 10:11
  • This is exactly why I *hate* snap packages with a burning passion. They fail in unexpected ways, there is so much regression from the "normal" packages, and the fact that this is default and not opt-in means this is the experience normal users will have. – MechMK1 Sep 16 '22 at 16:44