Open Bug 1304650 Opened 7 years ago Updated 24 days ago
Firefox use wrong default applications to open files in KDE5
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0 Build ID: 20160818000000 Steps to reproduce: 1. Install latest Firefox in Linux with KDE5 desktop. 2. Download a PDF file. 3. Click download icon in toolbar. 4. Open the file in download menu. Actual results: Firefox use LibreOffice Draw to open PDF files, rather than default PDF viewer in system. It also use LibreOffice to open all text file, rather than default text editor. It opens all images with GIMP, rather than default image viewer. Expected results: Firefox should use default application settings of KDE5.
Component: Untriaged → File Handling
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Hi, Yunhe, Good day, I'm not sure if the settings of LibreOffice overwrite the PDF settings on Firefox. May I have your help to check the application preferences by following steps? Thank you. Steps: 1. Launch Firefox 2. Type "about:preferences#applications" in URL bar 3. Type "PDF" in search field and check the default application to see if it's "Preview in Firefox"
Priority: -- → P3
Default PDF action is "Save file". Sorry the screenshot is in Chinese. http://imgur.com/81XOVvY
(In reply to Guo Yunhe from comment #2) > Default PDF action is "Save file". Sorry the screenshot is in Chinese. > > http://imgur.com/81XOVvY No worries. Please chose the "在 Firefox 中预览" to see if it can solve your problem. I am going to monitor this problem to see if I can get similar cases. Sorry for any inconvenience.
(In reply to William Hsu [:whsu] from comment #3) > Please chose the "在 Firefox 中预览" to see if it can solve your problem. This won't solve the problem. Though the PDF file can be previewed inside Firefox, I still need to download some PDF files sometimes. When I downloaded the PDF file and click it in download menu, Firefox use LibreOffice Draw to open it. Images, like JPEG and PNG, will be opened in GIMP when download finished.
(In reply to Guo Yunhe from comment #4) > (In reply to William Hsu [:whsu] from comment #3) > > > Please chose the "在 Firefox 中预览" to see if it can solve your problem. > > This won't solve the problem. Though the PDF file can be previewed inside > Firefox, I still need to download some PDF files sometimes. When I > downloaded the PDF file and click it in download menu, Firefox use > LibreOffice Draw to open it. Oh! My bad. I misunderstood the problem. Because your operation system set LibreOffic as PDF default application, that's why you cannot open it in Firefox. The article may help you. Have a nice day. - http://www.ghacks.net/2009/08/24/change-default-and-preferred-applications-in-kde/ > > Images, like JPEG and PNG, will be opened in GIMP when download finished.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
No No No In my KDE file manager Dolphin, I can open PDF with Okular PDF Viewer by default. But only in Firefox, it ignores the KDE default applications and uses gconf. However, since I am not using GNOME, gconf doesn't have any customized default applications. So Firefox open PDFs with wrong applications.
Please do not close this bug!
From what I read here, it seems like an actual problem with platform support in Firefox, but as far as I know we don't have someone on the team that has the expertise needed to fix the bug. We would probably need a KDE developer or someone with the right expertise to take a look and provide a patch.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: P3 → P5
I've ran into this bug as well, for me it manifests as Firefox suggesting me to open PDF files using GIMP which is obviously not really desirable. This bug is quite nasty as it renders the "open with" option useless. There is an Freedesktop specification  on how to determine the default application for a MIME given type. This specification is actually implemented by Firefox, see bug 694870. However, from what I've read, KDE doesn't seem to conform with that specification. There are a few indicators for this: * When I run xdg-mime query default application/pdf, it correctly gives me the .desktop file for Okular, not GIMP. However, when I look into the source code for xdg-mime, I see a conditional where the default behaviour is to scan using the freedesktop spec, but the behaviour on KDE is to use a tool called ktraderclient. Now why should the authors of xdg-mime have done that, if not because KDE doesn't use the spec? * When I force the script to go with the "spec" path on my computer, it doesn't give me a correct result. This seems to be a confirmation. For completion's sake, running ktraderclient --mimetype application/pdf | grep "DesktopEntryPath" gives me correctly the .desktop file for Okular. * When I run gnome-open <path to pdf file>, it opens me the file with GIMP as well. Most likely gnome-open uses the same API that Firefox also uses to get the default application information. However, xdg-mime, Dolphin, and other programs all open the pdf file correctly with okular. Also, in my KDE system settings, Okular shows up as the default application to open pdf files. Now this means there are two bugs: * One bug with Firefox, that it doesn't provide better integration with KDE (bug 140751 as a tracking issue). In bug 694870 comment 25 it is mentioned that there are patches by SUSE for firefox that do provide better KDE integration, and where this functionality works as expected. * And one bug with KDE, that it doesn't implement the Freedesktop spec but seems to do its own stuff. For resolving this on the Firefox side, you could: * either apply the SUSE patch (not sure if that's possible legally as if it were, why is it still not applied?) * or figure out how to build against KDE frameworks and then use  KMimeTypeTrader to obtain the result (not sure if that's possible legally as the KDE frameworks are under LGPL AFAIK) * or do it like xdg-mime and add some detection for whether we are on KDE (e.g. by checking the XDG_CURRENT_DESKTOP env var) and if we are, launch a ktraderclient process and parse its output. This should have the least legal issues of the three approaches. : https://standards.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html#default : https://api.kde.org/frameworks/kservice/html/classKMimeTypeTrader.html
Same problem here. User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0 plasmashell 5.14.4 KDE Frameworks: 5.53.0
Severity: normal → --
Priority: P5 → --
Hardware: x86_64 → All
Version: 48 Branch → Trunk
Component: File Handling → Widget: Gtk
Product: Firefox → Core
You need to log in before you can comment on or make changes to this bug.