Siduction Forum

Siduction Forum => Software - Support => Topic started by: sunrat on 2020/08/06, 02:02:33

Title: Firefox download handler
Post by: sunrat on 2020/08/06, 02:02:33
When I open the Downloads drop down from the icon in its taskbar and click on a downloaded PDF file, it opens in GIMP. I'd like to set Okular instead of GIMP in the FF Downloads box. 
In FF preferences PDF is set to "Save File". System handler is set to Okular. Opening a PDF in Dolphin uses Okular as expected.
 I searched for "gimp" and "pdf' in about:config with no result. And I checked, config search is case insensitive.
Where is the FF Downloads handler set?
Title: Re: Firefox download handler
Post by: toga on 2020/08/06, 09:47:37
Have you tried this:

„General“, „Applications“, use „search for .pdf“ and select „use other“ or „use system default application“.
so i can open pdf with firefox or ocular.

Hope this helps,

toga
Title: Re: Firefox download handler
Post by: sunrat on 2020/08/06, 10:19:54
„General“, „Applications“, use „search for .pdf“ and select „use other“ or „use system default application“.
so i can open pdf with firefox or ocular.

I already said it is set there to "Save File" and I know I can change it like you said but that's not the question I asked. When clicking on the Downloads arrow icon in the taskbar after downloading it offers a choice to "Open file" or "Open containing directory". Open file there it opens it in GIMP. I want it to open in Okular from there instead.
Title: Re: Firefox download handler
Post by: jure on 2020/08/06, 13:13:45
I think toga means this

(https://up.picr.de/39168109nl.png)
Title: Re: Firefox download handler
Post by: sunrat on 2020/08/06, 15:10:00
I know that's what they mean. It's not relevant to what I am asking. It seems words aren't working so see this visual explanation. I wish to open the already downloaded file in Okular by clicking "Open file" in the Downloads box.

(https://i.postimg.cc/KYCtvxqK/ff-pdf-dl.png)
Title: Re: Firefox download handler
Post by: titan on 2020/08/06, 18:32:01
Can you right click on file and get "open with system viewer"  which will be Okular if that is system viewer
Title: Re: Firefox download handler
Post by: jure on 2020/08/06, 18:53:26
system-configuration>application>file allocation>pdf>okular
Title: Re: Firefox download handler
Post by: sunrat on 2020/08/07, 01:28:52
Can you right click on file and get "open with system viewer"  which will be Okular if that is system viewer
Still opens in GIMP.

system-configuration>application>file allocation>pdf>okular
System viewer is set as Okular.
Firefox is doing it wrong. My question is where does FF save the setting for this? It didn't show in about:config .
It's not a great problem as I can open the Download folder from there and click on the file where it does actually open in the system viewer Okular. It's just not working correctly and I have to fix it. Call it an obsession.  :P ;)
Title: Re: Firefox download handler
Post by: jure on 2020/08/07, 09:07:00
about:config

(https://up.picr.de/39172383rf.png)
Title: Re: Firefox download handler
Post by: der_bud on 2020/08/07, 09:16:22
These are sometimes ocurring mimetype hickups combined with firefox' file picker. Your system (and so your filemanager) are set to open pdf with okular, probably preconfigured via xdg-open, one of the many standards
Firefox as gtk app might use gio-open instead, another standard. In earlier versions of firefox (pre-68 I think) there was an about:config setting for ui.allow_platform_file_picker, resulting in internal firefox dialog windows using your desktopmanagers filemanager.

What you can try:
 - look in your local mime database, one of the two files ~/.local/share/applications/defaults.list or ~/.local/share/applications/mimeapps.list, if there is any line combinig pdf with gimp, and see if you can correct that somehow

 or

 - in a terminal, check the diffents between
Code: [Select]
xdg-mime query default application/pdf and
Code: [Select]
gio mime application/pdf If the xdg one points to okular and the gio one points to gimp, that is the culprit. So correct it with setting
Code: [Select]
gio mime application/pdf okular.desktop
 update-mime-database ~/.local/share/mime
 update-desktop-database ~/.local/share/applications

- Additionally (you use KDE I think) in Systemsettings there are settings for applications and filetypes, search for pdf and look if gimp is there even as second and third choice, if so delete that.

All of that is just assumed, but hopefully thats enough vocabulary to feed your internet search machine ;)

Some hints I got from:
https://bugzilla.mozilla.org/show_bug.cgi?id=1427700
https://deluge.readthedocs.io/en/latest/how-to/set-mime-type.html
https://unix.stackexchange.com/questions/36380/how-to-properly-and-easy-configure-xdg-open-without-any-environment#comment512430_59088
https://unix.stackexchange.com/questions/146904/set-new-default-file-manager-for-firefox-in-archlinux
Title: Re: Firefox download handler
Post by: sunrat on 2020/08/07, 10:48:39
Direct hit, der_bud. Thank you.  ;) 8)

Needed a minor adjustment, this is what fixed it:
Code: [Select]
$ gio mime application/pdf okularApplication_pdf.desktop
Set okularApplication_pdf.desktop as the default for application/pdf
$ update-mime-database ~/.local/share/mime
$ update-desktop-database ~/.local/share/applications

I didn't even know about gio-open. The FF profile is probably from way before v68 so it may have depended on that deprecated about:config setting.
Didn't need to touch KDE System Settings.