4

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
  • 5,005

1 Answers1

3

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.

ignite
  • 8,936
  • Can you detail the steps for doing it. Without that, your answer is vague and incomplete. – mikewhatever Feb 28 '13 at 12:57
  • Detailed steps, https://help.ubuntu.com/community/AddingMimeTypes – Siamore Feb 28 '13 at 13:16
  • My mime.types and defaults.list have the same entries as yours. – Eyal Feb 28 '13 at 13:29
  • What 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 – ignite Feb 28 '13 at 13:58
  • It 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. – Eyal Feb 28 '13 at 17:06
  • Check ~/.local/share/applications/mimeapps.list, do you have some different entry there? – ignite Feb 28 '13 at 17:42
  • I don't see anything relevant: here's what I have: [Added Associations] application/x-shellscript=gedit.desktop; text/plain=gedit.desktop; text/x-java=meld.desktop; application/xml=meld.desktop;vlc.desktop; application/octet-stream=gedit.desktop;meld.desktop; – Eyal Mar 03 '13 at 10:00
  • 2
    In 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. – ignite Mar 03 '13 at 17:32
  • Exactly right! When I removed this entry, Firefox reverted to using LibreOffice by default. Thank you very much! – Eyal Mar 04 '13 at 07:50