https://bugs.documentfoundation.org/show_bug.cgi?id=166301

            Bug ID: 166301
           Summary: Installing local help files breaks all LO Help on
                    Ubuntu (due to Firefox...)
           Product: LibreOffice
           Version: 25.2.0.0 alpha0+
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Documentation
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Local help files are valuable because they allow Help to work when not
connected to the Internet.  But in recent Ubuntu systems, at least, Help is
completely broken if local help files are installed.

The problem is the Firefox browser, which nowadays can only access
file:///local/path URLs within the users Home Directory (dotnames such as
.local are also excluded).  This is because Firefox is now a 'snap', which runs
in a chroot sandbox, as well as changes within FF itself.  There may be ways to
custom-configure access to additional local files but it istoo much to ask
ordinary users to do that.

Remote help is broken too, when local help files are installed, because when
the files are installed LO opens the system browser (Firefox) to access the
local files and assumes it worked; there is no way to know that Firefox failed
to open the help files, and so LO can not know to fall back to remote help. 

Unfortunately there is nothing we can do about Firefox or snap.

But some work-arounds might improve the situation:

------

1. Allow local help to work if LO is installed in the user's Home Directory:

(IMO this should be done in any case, and requires only simple changes)

LO creates a small redirector file /tmp/XXXXX.tmp/NewHelp0.html and points the
browser to that. That file redirects to the absolute paths of the installed
help/index.html (or help/nen-US/noscript.html if javascript is disabled). 

Since Firefox can not see /tmp this does not work.  To fix this, create the
redirector in the users' Home Dir in e.g.
$HOME/LibreOfficeDev/XXXX.tmp/NewHelp0.html (it can't be in the profile dir
under $HOME/.config because FF won't access dot-names).

I've tested this (by copying the file from /tmp) and it works -- local help
functions provided LO is itself installed within the user's Home Directory.

OK, this would fix the problem for a few people like us who install test
versions of LibreOffice in our home dirs.


2. Fall back to remote help if local help does not work.

*Here I'm stepping beyond my knowledge, so this might or might not be possible:

Make the redirector javascript use fetch(url) or XMLHttpRequest to load a tiny
test page in the local help tree, just to see if it can (examining the returned
text to see if an expected signature was returned).  If not, the redirector
would fall back and redirect to Internet-based help instead of the local files.

[
It might instead redirect to a special page somewhere in libreoffice.org which
would first display a warning to the user, something like:

Local help files are installed but your browser <agent name> can not access
them.   To prevent this message in the future, un-install the local help files,
or manually delete <local path to the test page>." and display a "Try
LibreOffice help on the Internet" button and wait.  After the user clicked, it
would redirect to the real help page.

(all the specifics would be passed as ?query parameters from the redirector
script. which does not know how to display anything really, to the hand-written
intermediate page in the libreoffice.org internet.)
]

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to