Unable to open any file:/// URL

Bug #1977782 reported by David Kastrup
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
firefox (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

The way this configures/installs the snap makes it impossible to open any file either from the command-line or by specifying a link of the file:/// kind. That makes firefox unusable for browsing local HTML documentation.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: firefox 1:1snap1-0ubuntu2
ProcVersionSignature: Ubuntu 5.15.0-35.36-lowlatency 5.15.35
Uname: Linux 5.15.0-35-lowlatency x86_64
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: XFCE
Date: Tue Jun 7 02:27:27 2022
InstallationDate: Installed on 2011-10-14 (3888 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111011)
Snap.Changes: no changes found
SourcePackage: firefox
UpgradeStatus: Upgraded to jammy on 2022-01-28 (130 days ago)

Revision history for this message
David Kastrup (dak) wrote :
Revision history for this message
madbiologist (me-again) wrote :

What happens when you press the Alt key to reveal the menu bar, then select "File", then select "Open File…" ? Is the file chooser/browser dialog displayed? If so, what happens after selecting a compatible file eg. image/plain text/HTML file? If an error message is displayed, please attach a screenshot of the error message to this bug report.

Changed in firefox (Ubuntu):
status: New → Incomplete
Revision history for this message
Chris Guiver (guiverc) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Unfortunately, we cannot work on this bug because your description didn't include enough information.

I just tried
1) guiverc@d960-ubu2:~$ firefox ~/d960_stats.txt
2) guiverc@d960-ubu2:~$ firefox /mnt/de2900/lan/guiverc/lshw_d755.txt
and firefox opened both times & showed me that file.

Firefox as a snap package runs confined, thus cannot read the whole file-system, so your issue maybe trying to read files on your file-system outside of where it has access (ie. user error), however you provided no specifics. Please be specific with examples of file locations, or commands where it failed to operate.

I've marked this bug as 'incomplete' as no specific examples were provided, and the firefox snap can open open files in $HOME, /mnt, /media.. but is limited to certain directories only for security purposes (confinement)

Bug reporting is mostly about finding & fixing problems thus preventing future users from hitting the same bug.

I suspect a Support site would be more appropriate, eg. https://answers.launchpad.net/ubuntu. You can also find help with your problem in the support forum of your local Ubuntu community http://loco.ubuntu.com/ or asking at https://askubuntu.com or https://ubuntuforums.org, or for more support options please look at https://discourse.ubuntu.com/t/community-support/709

Revision history for this message
David Kastrup (dak) wrote :

Ok, "any file" was wrong. The problem appears to be "any file in the /tmp hierarchy". That is a common destination for downloading and unpacking stuff, including by software that displays HTML by reverting to the system browser.

The error message then is

File not found

Firefox can’t find the file at /tmp/test-results/index.html.

    Check the file name for capitalization or other typing errors.
    Check to see if the file was moved, renamed or deleted.

Revision history for this message
Daniel Hatton (dan-hatton) wrote :

I don't think this is a duplicate of #1790608. #1790608 concerns launching an external file handler from Firefox, whereas this bug concerns launching Firefox from an external workflow, to handle a locally-stored HTML file.

Revision history for this message
Daniel Hatton (dan-hatton) wrote :

To answer @me-again's question: if one uses the File menu->Open file facility in an attempt to open a file in /tmp, then Firefox copies the file to a newly-created directory in the /run/user hierarchy, and opens that new copy of the file with a file:// URI.

This problem appears to be a side-effect of some sort of attempt by the Firefox developers to mitigate the security vulnerability described at <https://thehackernews.com/2019/07/firefox-same-origin-policy-hacking.html>.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.