Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox snap has no access to /tmp profiles path #183

Open
benkuly opened this issue Dec 23, 2021 · 9 comments
Open

Firefox snap has no access to /tmp profiles path #183

benkuly opened this issue Dec 23, 2021 · 9 comments

Comments

@benkuly
Copy link

benkuly commented Dec 23, 2021

When running Firefox as snap, he does't have access to the /tmp directory and therefore firefox cannot load the profile. It was really hard to debug, because FIrefox doesn't fail to start in -headless mode and therefore there is just a karma timeout.

FIrefox solves that by putting tmp files into ~/Downloads/firefox.tmp/.

@jginsburgn
Copy link
Member

I did not understand the problem. Can you clarify and provide repro steps?

@benkuly
Copy link
Author

benkuly commented Jan 8, 2022

Repro: Install Firefox as snap (linux) and remove other installed Firefox.
When running as snap, Firefox has very limited access to the filesystem, as described in the issue description.

@isostatic
Copy link

Create a file in /tmp, say using xfce4-screenshooter

$ ls -l /tmp/Screenshot_2022-08-22_11-19-13.jpg 
-rw-rw-r-- 1 me mygroup 87400 Aug 22 11:19 /tmp/Screenshot_2022-08-22_11-19-13.jpg

Try to open the file in Firefox

file:///tmp/Screenshot_2022-08-22_11-19-13.jpg

Reports the following

File not found
Firefox can’t find the file at /tmp/Screenshot_2022-08-22_11-19-13.jpg.
    Check the file name for capitalisation or other typing errors.
    Check to see if the file was moved, renamed or deleted.

Potentially firefox in a snap thinks /tmp is stored in ~/Downloads/firefox.tmp

firefox prevents access to folders like /var, /etc, /opt. but with /tmp it fakes it. Going to "/" does not show all directories either -- creating a root directory "/test", and even chmod/chowning to the user, does not update. This might be because firefox snapshots it on bootup?

Firefox does allow access to /var/tmp, which is updated.

It's inconsistent and not very well explained.

@perry-mitchell
Copy link

Any fix for this? Running into it in Karma+Firefox now, Ubuntu 22.04, Firefox 104.0.2:

image

@oyejorge
Copy link

oyejorge commented Oct 3, 2022

What's your karma config for launching Firefox?

@ipbc-dev
Copy link

Hi. So this seems to be the issue I am facing after all.

Unfortunately it seems Firefox from apt is also broken to some extent, just differently so no longer a workaround :(
https://askubuntu.com/questions/1435994/broken-mozilla-firefox-no-text-displays-font-issue

Would be really nice if #47 could be fixed/merged.

Thanks in advance.

@birtles
Copy link
Collaborator

birtles commented Oct 19, 2022

Would be really nice if #47 could be fixed/merged.

I went to go and update #47 for merging but I noticed we already have the profile option for specifying the path to an existing profile. Is that enough? Or do we also need a profileName option for loading a profile by name instead?

@ipbc-dev
Copy link

Many thanks for your reply. I confirm the profile option works correctly.

        customLaunchers: {
            'FirefoxHeadless': {
                base: 'Firefox',
                flags: [ '-headless' ],
                profile: require('path').join(__dirname, 'tmp'),
            }
        },

I leave this as an exercise to a future reader to define a good, possibly random, location and clean up after test suite completes, if necessary. This should make us able to workaround this annoying bug that Ubuntu snap has.

jbms added a commit to google/neuroglancer that referenced this issue Nov 28, 2022
@wleoncio
Copy link

wleoncio commented Mar 7, 2023

Firefox does allow access to /var/tmp, which is updated.

Cheers for the workaround! I like to have my downloads saved to /tmp, which I've been unable to do on Firefox snap, but /var/tmp is the next best thing. :)

nikku added a commit to bpmn-io/diagram-js that referenced this issue Jul 4, 2024
Using a local profile directory, this works on modern Linux, too:

karma-runner/karma-firefox-launcher#183 (comment)
nikku added a commit to bpmn-io/diagram-js that referenced this issue Oct 1, 2024
Using a local profile directory, this works on modern Linux, too:

karma-runner/karma-firefox-launcher#183 (comment)
nikku added a commit to bpmn-io/diagram-js that referenced this issue Oct 2, 2024
Using a local profile directory, this works on modern Linux, too:

karma-runner/karma-firefox-launcher#183 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants