mullvad / mullvad-browser

Privacy-focused browser for Linux, macOS and Windows. Made in collaboration between @torproject and @mullvad
https://mullvad.net/browser
1.32k stars 25 forks source link

File dialog sometimes fails to open #267

Open matt-hayden opened 4 months ago

matt-hayden commented 4 months ago

Greetings,

Workaround for a problem with containerized Mullvad failing to launch a file dialog.

Expected behavior works on the related Tor browser:

  1. Ctrl-O opens a file dialog to choose a local file
  2. File -> Save Page As can open a file dialog
  3. Bookmark Organizer -> Restore -> From file can open a file dialog

On Mullvad:

  1. works as above
  2. silently ignored
  3. silently ignored

What appears when run with --log:

Mullvad Browser:14): Gtk-CRITICAL **: 20:34:43.030: Unable to create user data directory '/home/mullvad/.var/mullvad-browser/Browser/.local/share' for storing the recently used files list: Not a directory

Both Tor and Mullvad beget Browser/.local/share symlinked to /dev/null. Replacing this with a directory is the workaround.

My environment may matter:

Those browsers are both in the same Arch Linux container, with a variant of Ubuntu as host.

||/ Name              Version                                         Architecture Description
+++-=================-===============================================-============-=================================
ii  systemd-container 249.11-0ubuntu3.11pop0~1704473387~22.04~3ce38bf amd64        systemd container/nspawn tools

systemd-nspawn was chosen because only a few extra options are needed to permit browsers to play audio.

On Arch, the dependencies for Firefox are installed and the choices during that installation were noto-fonts and pipewire-jack. Tor Browser is installed from the Arch Linux torbrowser-launcher package. Mullvad browser is simply dropped into place from the 13.5 tarball.

Outside of this containerization, Mullvad on the host machine runs fine with Browser/.local/share symlinked to /dev/null.

boklm commented 1 month ago

Both Tor and Mullvad beget Browser/.local/share <- /dev/null. Replacing this with a directory is the workaround.

Note that replacing this symlink with a directory may leak on disk the list of downloaded URLs. The symlink to /dev/null was added to fix this issue: https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/17560

On Arch, the dependencies for Firefox are installed and the choices during that installation were noto-fonts and pipewire-jack. Tor Browser is installed from the Arch Linux torbrowser-launcher package. Mullvad browser is simply dropped into place from the 13.5 tarball.

I'm wondering if the different behavior between Mullvad Browser and Tor Browser can be explained by the different dependencies installed. Are you running Mullvad Browser in the same container as Tor Browser? If not, can you try running it with the same dependencies installed to see if it solves the issue?