DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 4th January 2020
gustaf gustaf is offline
Fdisk Soldier
 
Join Date: Dec 2016
Posts: 68
Default Firefox 71.0 won't Open, Save, or Upload files

I'm having the same problem as acampbell (see post #8 in Chrome or Firefox).

Per jggimi's suggestion (see post #9 in Chrome or Firefox), both /tmp and ~/Downloads are ordinary directories. They are not symlinks.

From /usr/local/share/doc/pkg-readmes/firefox:
Code:
pledge(2) and unveil(2) Support
===============================
Firefox on OpenBSD is secured with pledge(2) and unveil(2) to limit
the system calls and filesystem access that each of Firefox's three
process types (main, content, and GPU) is permitted.  By default,
only ~/Downloads and /tmp can be written to when downloading files,
or when viewing local files as file:// URLs.

Files containing pledge promises and unveil paths and permissions
for each type of process are located in
/usr/local/lib/firefox/browser/defaults/preferences/.
Each file can be overridden by copying it to /etc/firefox/
and modifying it.
Viewing local files as file:// URLs works as expected. The default configuration gives me access to ~/Downloads and /tmp. Trying any other directory results in a "File not found" error.

Copying the configuration files to /etc/firefox and modifying them also worked:

Code:
# Make a firefox directory in /etc
cd /etc
doas mkdir firefox

# Copy firefox default config files to /etc/firefox
cd /usr/local/lib/firefox/browser/defaults/preferences
doas cp unveil.content unveil.main /etc/firefox

# Modify the copied config files
cd /etc/firefox
# Open unveil.content and unveil.main with a text editor; add the line
# ~/Firefox r 
# to each file

# Make a test directory containing a test file
cd $HOME
mkkdir Firefox
cd Firefox
vi FirefoxTEST.txt
# Type in some text and quit vi
After making these changes, I was able to view FirefoxTEST.txt by typing file:///home/gustaf/Firefox/FirefoxTEST.txt into the URL bar in Firefox.

So far, so good.

BUT, this does not work with any of the dialogue boxes (Open, Save, Upload, etc).

When I try, for example, to save a file with File > Save Page As..., clicking + Other Locations in the left pane of the dialog brings up Computer in the right pane. Clicking Computer makes the right pane go blank. In the dialog boxes, my entire filesystem is invisible to Firefox. Given the instructions in /usr/local/share/doc/pkg-readmes/firefox:
Code:
...By default, only ~/Downloads and /tmp can be written to when downloading files...
I would think that the dialog boxes would at least provide access to ~/Downloads and /tmp when clicking Computer.

Many thanks to anyone who can provide some insight.

Last edited by gustaf; 4th January 2020 at 09:33 AM. Reason: clarity
Reply With Quote
  #2   (View Single Post)  
Old 5th January 2020
acampbell acampbell is offline
Real Name: Anthony Campbell
Shell Scout
 
Join Date: Sep 2014
Location: London, UK
Posts: 138
Default

You're right; typing the address as a url works for for for files in ~/Downloads. So it seems to be a problem with the dialoge boxes in Firefox. There is something similar in Chrome; here the file access dialogue does work correctly but trying to import a bookmarks file produces the same dialogue page as with Firefox, i.e. no access to any local directories.
Reply With Quote
  #3   (View Single Post)  
Old 6th January 2020
newtowndaemon's Avatar
newtowndaemon newtowndaemon is offline
New User
 
Join Date: Nov 2017
Posts: 3
Default

Short answer: add the Firefox folder you want to add to your gtk-bookmarks file. It will then appear in the firefox file chooser in the left hand pane above the Other Locations thingy.

Create or edit ~/.gtk-bookmarks and add the full file URL to there:

Code:
file:///home/yourusername/Firefox
That works for me. Make sure the folder has been unveil'd first.

Hope that helps

Simon
Reply With Quote
  #4   (View Single Post)  
Old 10th January 2020
gustaf gustaf is offline
Fdisk Soldier
 
Join Date: Dec 2016
Posts: 68
Default

Hi newtowndaemon, and welcome!

Many thanks for pointing the way towards the gtk-bookmarks files.

I had to create the file ~/.config/gtk-3.0/bookmarks, then add the full file URL there.
After unveiling the folder, I quit, then restarted Firefox.

It worked!

See GTK Bookmarks and ~/.gtk-bookmarks is deprecated for an explanation of the difference between gtk2 and gtk3 bookmarks.

Last edited by gustaf; 10th January 2020 at 01:49 AM. Reason: clarity
Reply With Quote
  #5   (View Single Post)  
Old 10th January 2020
acampbell acampbell is offline
Real Name: Anthony Campbell
Shell Scout
 
Join Date: Sep 2014
Location: London, UK
Posts: 138
Default

Thanks to someone on misc@ who provided a link I've finally managed to get the file selector (Ctrl-o) to work again with ~/Downloads. It seems the problem has been that Firefox didn't know about the existence of this directory. I downloaded and saved a file in ~/Downloads, after which all the files in that directory appeared in the file selector.

See
https://www.reddit.com/r/openbsd/com...ile_to_upload/
Reply With Quote
  #6   (View Single Post)  
Old 10th January 2020
newtowndaemon's Avatar
newtowndaemon newtowndaemon is offline
New User
 
Join Date: Nov 2017
Posts: 3
Default

Quote:
Originally Posted by gustaf View Post
I had to create the file ~/.config/gtk-3.0/bookmarks, then add the full file URL there.
Yeah I nearly mentioned the GTK3 version but then proceeded to do a quick and dirty test using ~/.gtk-bookmarks file before posting and it worked for me. I tried that method first because I wasn't sure if firefox was linked against GTK2 or GTK3 (it's GTK3 BTW, I just checked) so I never tried the GTK3 way.

At least you got sorted in the end.

Simon
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp upload files using the (S)hell ershiba OpenBSD Installation and Upgrading 4 31st December 2012 04:53 PM
list open files - fstat? jsmith6134 OpenBSD General 3 2nd September 2011 03:11 AM
Can't open PDF files, FBSD 7.2-release Mantazz FreeBSD Ports and Packages 7 24th December 2009 01:10 PM
Firefox PROTIP: getting back to a normal Save As Dialogue. caesius Guides 5 15th October 2008 06:24 AM
How to view & open DOCX files in Ubuntu/OpenOffice. unixdude Other BSD and UNIX/UNIX-like 0 11th July 2008 08:38 AM


All times are GMT. The time now is 08:25 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick