Comment 8 for bug 1958813

Revision history for this message
In , Sygczsjy (sygczsjy) wrote :

User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0

I have observed the same problem. Ubuntu 21.10, default installed Firefox, Snap version 93.0 according to About Firefox.

If the user deletes the directory ~/Downloads/firefox.tmp/ while Firefox is running, Firefox may recreate it at a later point. In some cases the directory is empty. In other cases, it contains temporary files.

My best guess is that it has to do with a change noted in [this thread](https://forum.snapcraft.io/t/xdg-open-not-working-on-firefox/17670/14):

> There’s no `mimeapps.list` file any more, and the `snapcraft.yaml` now sets `GTK_USE_PORTAL=1` in the environment. This causes the GLib APIs to ask `xdg-desktop-portal` to open any files it can’t otherwise find a handler for.
>
> The other change in tip is to set `$TMPDIR` to somewhere other than `/tmp` (specifically, it sets it to `~/Downloads/firefox.tmp`). When Firefox tries to open a file of a type it doesn’t understand, it downloads and saves a copy of it to the temp files directory, and then tries to open that file with its associated handler. This is a problem for snaps, since `/tmp` inside the sandbox is different to `/tmp` outside of the sandbox. Using a different location allows the file to be passed to the helper outside the sandbox.