Opening .docx attachments in Firefox using LibreOffice
For file types that are not stored in Firefox preferences, Firefox uses your default system settings. Make sure that mime-type for .docx
is correctly set in /etc/mime.types
and the default application for that is Libre Office.
How to verify settings?
These are the settings for me, you can compare these with yours. I have an entry: application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
in /etc/mime.types
.
Corresponding to that I have an entry:
application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop
in /usr/share/applications/defaults.list
. Also check ~/.local/share/applications/mimeapps.list
for this entry.
Setting the default application
This is already explained in answers to this question.
I have checked everything, still it fails
This may be because Firefox is not able to determine correctly the mime-type for the file. This link gives a detailed explanation of how Firefox determines mime-type for a file. This concerns Mozilla and you should report a bug at Bugzilla.
Related videos on Youtube
Eyal
Updated on September 18, 2022Comments
-
Eyal over 1 year
I'm trying to open .docx files from the Outlook Web App, viewed in Firefox, with LibreOffice. LibreOffice is installed on my computer and the default application for opening .docx files. What's more, in the preferences->applications of Firefox, I see LibreOffice Writer as the default for Microsoft Word files and don't see any other entry for .docx files. But when I click on an attached .docx file, Firefox asks me whether to download it or open it with gedit. If I manually choose lowriter from this dialog, Firefox doesn't remember this choice and let me pick it afterward.
UPDATE: I noticed something strange - it seems like this doesn't happen for all .docx files, but rather for files whose name starts with a number(for example, 1234.docx).
Files with alphabetical prefixes are opened fine by Firefox (for example, abcd.docx).
Any ideas? I'd love to be able to open these files in one click, instead of downloading them and only then opening them in Writer.
-
Eyal about 11 years@fleamour It's correctly set to LibreOffice Writer.
-
nutty about natty about 11 yearsEyal, you may also find docs.google.com/viewer (notice the word
viewer
) useful to generate links to "quickly view documents online without leaving your browser". Not what you're asking for, but maybe helpful, too...? -
Eyal about 11 yearsIt is useful! In some ways it's more of an answer to this other question I asked about viewing Word docs rather than this one.
-
-
mikewhatever about 11 yearsCan you detail the steps for doing it. Without that, your answer is vague and incomplete.
-
Siamore about 11 yearsDetailed steps, help.ubuntu.com/community/AddingMimeTypes
-
Eyal about 11 yearsMy mime.types and defaults.list have the same entries as yours.
-
ignite about 11 yearsWhat does firefox say in the dialog Opening blabla.docx? For me it says You have chosen to open blabla.docx which is a:Microsoft Word Document
-
Eyal about 11 yearsIt correctly identifies it as a "Microsoft Word Document" but offers gedit (the default application) and nothing else. "Do this automatically for files like this from now on" is disabled.
-
ignite about 11 yearsCheck ~/.local/share/applications/mimeapps.list, do you have some different entry there?
-
ignite about 11 yearsIn that case, Mozilla is unable to detect the mimetype and hence uses application/octet-stream, if you change the entry of application/octet-stream=gedit.desktop, then you will be prompted for a different application.
-
Eyal about 11 yearsExactly right! When I removed this entry, Firefox reverted to using LibreOffice by default. Thank you very much!