-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Can't use LibreOffice's Help, or HTML files with accompanying CSS files, in Flatpaked browsers #555
Comments
@ramcq You made a reference to a previous conversation about a |
I don't think this is a case for neighboring files which are about the host's files, not those of sandboxed applications or a runtime. It's more of a file-application association. Also, asking a user if they are ok with opening An alternative can be flatpak having a dedicated "web engine" to display documents, or use that of a runtime if there is one (for example, that of the GNOME runtime). This should be intended for offline viewing (so no network access), so apps can use it as is without asking, all in a proper interface. |
Flatpak:ed LibreOffice ships an offline version of its extensive documentation in a runtime,
org.libreoffice.LibreOffice.Help
. My default web browser is also a Flatpak application. (It doesn't particularly matter which one because all of Chromium, Firefox and Epiphany exhibit all the problems described here, with one exception that I will call out.)When I hit F1 in LibreOffice, as best I can tell it writes a temporary file to some location or other, then invokes
xdg-open
or equivalent on it. I see the OpenFile method call (with just an FD), then the browser being activated on/run/user/1001/doc/dcca5ada/NewHelp1.html
.That file is as follows, though I have pretty-printed it for legibility:
So, the browser opens at that file, and follows the redirect to
file:///var/lib/flatpak/runtime/org.libreoffice.LibreOffice.Help/x86_64/stable/22757a622f8d4a5cb563e0249b84d2ef425c96d4b16e3dbdb692d199ea1e086c/files/index.html?Target=swriter/SW_HID_EDIT_WIN&Language=en-GB&System=UNIX&Version=7.0
, which of course it cannot access because that path on the host is not visible in the sandbox.One part of the issue here is that LibreOffice has this indirection through a temporary file. Flatpak is able to arrange for that path to be accessible to the target application through the document portal, but has no idea that the target application will try to open a completely different path. I assume that it does this because it wants to pass query parameters through to the target application (which is not supported by
OpenFile
), andOpenURI
explicitly does not supportfile:///
URIs.But even without that indirection, there is still an issue. Suppose I have the following two files,
index.html
andindex.css
, somewhere in my home directory:When I use Nautilus to open
index.html
in Epiphany or Firefox, they are passed a document portal path. But onlyindex.html
is mapped, not its sibling file, so the text is black, not red. (Chromium currently has access to home for reasons, so this can't be reproduced there.)Some possible approaches:
I'm not entirely sure what the conditions for the third approach would be – it's by design that opening a file does not share the entire directory tree in general, because then opening a file in
~
would give the app access to the whole home directory. So I guess it would need to be opt-in by the requesting application.The text was updated successfully, but these errors were encountered: