Changing temp directory of Firefox snap


Firefox installed using snap on Jammy Jellyfix always creates ~/firefox.tmp folder on startup. I would like to change the location of this temp directory . Is there a way to do this ?


Snaps always get a private tmp,. so that they cannot access potentially sensitive files in your regular /tmp by accident (eg. X11 cookie).

What do you want to change it to?

If it can be a hidden folder such as ~/.firefox.tmp or within the snap folder of firefox `~/snap/firefox’ that would be swell. Having snaps create temporary folders in a users home directory is all I am trying to avoid.

From the firefox snap’s launcher script:

# Strictly confined snaps have a private /tmp area, not shared with other
# applications. This is a workaround to enable opening files downloaded with
# Firefox with other apps installed on the host system.
# See for details.
export TMPDIR="$(xdg-user-dir DOWNLOAD)/firefox.tmp"

If this firefox.tmp folder ends up being created in your home directory, that means your XDG download folder is your home directory. Perhaps that’s intentional, or perhaps you could change it to a subdirectory of your home?

Thank you. Indeed. I did configure the xdg download directory as my home directory. This does indeed provide me a solution as you suggest. Thank you again.