So, I try to access a documentation for something which is saved as locally saved HTML files with various subfolders, images & html files. The problem is, when I try to open it, the file path is like file:///run/user/1000/doc/RANDOMID/filename.html. So far so bad, but it seems like each subfolder and / or file gets sandboxed into its own random ID folder, which means it completely breaks every single file path that it hyperlinks to, making the entire documentation unusable.
How do I stop this, or work around this without much hassle?
I tried Firefox, Librewolf, Mullvad Browser, and Ungoogled Chromium. What happens when you press CTRL + O does not matter. As soon as you open an HTML file is when it gets shoved into a sandboxed folder, which you can see in the address bar
You can either temporarily enable “Filesystem → All user files” in Flatseal for your browser, or start a simple http server to serve your files. For the latter, navigate to your files in a terminal and run python -m http.server 8000 --bind 127.0.0.1, then open http://127.0.0.1:8000/ in your browser.
I guess I install yet another browser fork and have the user files permanently enabled for cases like this. Bit of a waste but I guess there’s no helping it for now.
And impossible to remember. I neither want to have to set up a web server every time I need to look at some HTML documents, nor do I want to always having to look up how to do that in the first place.
I just love how you assume that I even have the slightest idea on how to do whatever you’re trying to say, or that the last command is something I’d somehow remember in any easier way than the one in the first instructions.
There are ways to make what I am suggesting more user friendly, but it involves more super techy stuff.
But by using the approach I mentioned you avoid having to deal with the lengthy “file:/blah/blah/blah…” URLs.
You will be taken directly to the directory in question and can simply click on index.html.
I don’t happen to use the Ctrl-O approach because I feel navigating using the GUI dialog too much. Note the paths I commonly deal with are like /var/home/klmcw/src/github.com/klmcwhirter/python-projects/pi-day-2025-with-py/pi_ui.
Anyway, thanks for saying something. I need to adjust the approach I take here - especially in the General channel.
@j0rge, you’re welcome for the easy laugh. sigh.
I don’t use the ctrl+o approach either. I navigated to the folder structure in question through Dolphin (or rather in this case I opened it through Steam since it’s the subfolder of a game) and then just double clicked the “index” file.
And yes, throwing terminal commands or even loosely explained guides towards users seeking support isn’t helpful, because most will not have the background knowledge to do that. This is how Linux often gets some infamous stereotypes.
So far the second browser approach with the changed permissions seems to be the most convenient and persistent way that also easily works for other HTML documents, since I just have to “right click + open with” and select that browser now.
But of course it would be nice if sandboxed applications could maybe streamline this entire process, maybe by just starting a temporary webserver themselves whenever they have to handle local HTML files, or somehow respect the file structure of the subfolders & files below the parent HTML file and make sure they get sandboxed together instead of separately.
I understand, believe me, I do. But unfortunately the way things work is either: 1.) Do some hacky thing; 2.) Code it upstream to make it work for everyone.
I’ve been following that issue and NativeHostMessaging issue (for making browser extension able to talk to other applications; ie password managers and download managers) and it’s been almost a decade of the same discussions, a spurt of activity, and then months of nothing. Unless a person can and did the work, it’s just adding to the chatter, which doesn’t help. I’d recommend Brodie Robertson’s channel to keep track of these things, if you’d like.
Other than that, we don’t want to say “do these commands” either. It’s just the default thing people in Linux community does because it’s applicable to any users without making assumptions as to how their system is set up and used. Legitimately, this is why Flatseal is still part of the conversation, because otherwise you have to assume what DE the other person use, what version of it, and look up how to manage Flatpak permission for them.
Again, I understand and empathize with the frustration, but people just want to help the best way they can and… unfortunately it’s just how it is right now.
(PS - with regards to command, what I did back as a newbie was put them in a txt/note file, and later on move them to bash and zsh aliases – I don’t remember most of them either…)
But, @Dark-Thoughts - I have been around long enough to realize things are changing. And you (or me) should not accept things just because that is the way it has always been.
I, personally, just got complacent. I spent a lot of years in my career teaching people new technical concepts. I should know better.
I am used to dealing with very technical people in these forums. And @j0rge knew. That is why he laughed. He saw your response coming.
I had a fairly long career working with business users who “just needed to get things done” with the software my teams were building for them. I constantly heard their frustration with the fact they were being asked to help make (in some cases) what must have felt like very technical decisions.
So the good thing is that j0rge and Universal Blue are taking strides to put the focus on “getting work done”. Even if that work is playing a game or processing a Data Engineering pipeline. The underlying OS doesn’t matter - it’s the user’s ability to get things done that matters.
I am all for that change.
I just ask for patience with me while I adjust.
We will all be in a better place when we get to where j0rge is driving us all.
By default those browsers do not have access to your home directory.
You can either add them to ~/Downloads, or give the browser access to more files.
If these html files are all part of the same file directory, the easiest would be to add a flatpak override to expose that directory. Or give it access to your entire home or filesystem
Another options are to serve the files as have been mentioned.
Finally, if you do not want to do any of this, you could install a browser in a distrobox or layer and it will have access to everything.
But there are security concerns around opening the permissions for browsers like that. You could inadvertently open access to your home directory to some arbitrary nefarious code attached to an ad, etc. on a site you visit. Please be careful.
That is why knowing I only need that feature for viewing generated reports - I opt to quickly stand up a web server in the directory I am already in. And then quickly tear it back down as soon as I am done. It rarely stays up for more than an hour or so.