How to: change "default" filetype apps in firefox?

I’m using opensuse 11.1 and KDE 4.3 RC with firefox 3.5 (although I think it’s important to note that this problem occurred on stable KDE 4, and all versions of firefox I’ve used.)

Firefox associates the wrong programs with the wrong filetypes, and it’s very frustrating. For example: “png” files open with arora (a web browser) rather than gwenview, “torrent” files open with transmission (ugh…) instead of ktorrent, and “zip” files open with WINE (… WTF??) instead of ark.

Firefox doesn’t even always remember to use the correct apps when I choose to open files rather than save them, so while not a major inconvenience, it’s quite bothersome to navigate the dropdown menu for “ark” when i just want quick-access to a zip file’s contents. Also, opening files from the firefox download manager is an impossible task… Anyone else encounter this and have a fix?

sexyclient wrote:

> I’m using opensuse 11.1 and KDE 4.3 RC with firefox 3.5 (although I
> think it’s important to note that this problem occurred on stable KDE 4,
> and all versions of firefox I’ve used.)
>
> Firefox associates the wrong programs with the wrong filetypes, and
> it’s very frustrating. For example: “png” files open with arora (a web
> browser) rather than gwenview, “torrent” files open with transmission
> (ugh…) instead of ktorrent, and “zip” files open with WINE (… WTF??)
> instead of ark.

Try first with firefox edit / preferences / programs

> Firefox doesn’t even always remember to use the correct apps when I
> choose to open files rather than save them, so while not a major
> inconvenience, it’s quite bothersome to navigate the dropdown menu for
> “ark” when i just want quick-access to a zip file’s contents. Also,
> opening files from the firefox download manager is an impossible task…
> Anyone else encounter this and have a fix?

That sounds weird. It should follow the settings defined under edit /
preferences / general tab or edit / preferences / programs.

If they don’t work, try with a fresh-new “.mozilla” profile. Maybe something
within your firefox user’s profile is messed up.

Greetings,


Camaleón

I’ve tried, but the only problem is that when I want to save files and then open them I’d have to either: (1) open the files with the app I choose, then copy it from the temp directory, or (2) save them and then manually locate and open it with a file manager. I’ll try a new .mozilla profile to see if that works.

It seems to be okay. When you open a file directly from Firefox it’ll save the file to a temporary location. :slight_smile:

sexyclient wrote:

> I’ve tried, but the only problem is that when I want to save files and
> then open them I’d have to either: (1) open the files with the app I
> choose, then copy it from the temp directory, or (2) save them and then
> manually locate and open it with a file manager. I’ll try a new
> .mozilla profile to see if that works.

As ram88 says, that’s the expected behavior.

You can a) open the file on site with the selected app or 2) save it on your
selected location.

What do you exactly want to achieve? :-?

Greetings,


Camaleón

I’ll try starting over, being as simple and concise as possible: I’d like to be able to permanently save a file (not to the firefox temp folder) and then open it with it’s default app that has been set in KDE without having to manually locate the file (usually by navigating many folders through dolphin) but rather by opening it using the firefox download manager that conveniently pops up after the file is finished.

Sadly, though, this can’t happen because firefox tries to open: zip files with WINE, torrents with Transmission (instead of KTorrent,) png files with the Arora browser and a few other file-types with applications that aren’t associated with them by default.

That’s why, in short, I’d like to make firefox recognize the proper “default” applications that I’ve set in KDE for each file-type.

sexyclient wrote:

> I’ll try starting over, being as simple and concise as possible: I’d
> like to be able to permanently save a file (not to the firefox temp
> folder) and then open it with it’s default app that has been set in KDE
> without having to manually locate the file (usually by navigating many
> folders through dolphin) but rather by opening it using the firefox
> download manager that conveniently pops up after the file is finished.

I have not seen that behavior in any browser. Neither konqueror, opera,
firefox… not even in IE :slight_smile:

Coomon options are: open the file with the selected application without
saving it or save the file where you want.

> Sadly, though, this can’t happen because firefox tries to open: zip
> files with WINE, torrents with Transmission (instead of KTorrent,) png
> files with the Arora browser and a few other file-types with
> applications that aren’t associated with them by default.

You can change that.

Please note that firefox is not a kde application, so it handles mime types
on its own, but this can be configured.

> That’s why, in short, I’d like to make firefox recognize the proper
> “default” applications that I’ve set in KDE for each file-type.

Go to edit / preferences / programs and set the desired default applications
at your convenience.

Greetings,


Camaleón

I think you may be missing something. The application firefox considers as the “default” app to use is the one with the word “default” next to it in the dropdown list found either in the preferences’ “applications” tab under “action”, or in the file-download-prompt (which, might I add, is not to be mistaken with what I’m referring to as the download manager.) I want to use firefox’s download manager (the window titled “downloads”) to open files with the applications of my choosing. The ones I’ve chosen correspond to the apps I’ve set my OS/DE (operating system / desktop environment) to consider as the “default” for handling these “mime type”. Having my browser recognize the “default” application that has been set by the OS/DE I’m using (OpenSuse/KDE4 in this case) is the behavior I’ve become accustomed to in the browsers I’ve used before: firefox (on gnome, windows, pc-bsd and all other platforms I’ve used it on – and also on just about all other browsers I’ve used, for that matter.) I’m a bit surprised you’ve never encountered this behavior before in any browser you’ve used, Guest :frowning: . The convenience of it is truly a thing to marvel upon.

Changing the preferences in the application tab has no effect on the application firefox decides is the “default” to use for the file-type. Because the apps firefox considers as “default” is the one it uses when opening files from the download manager, changing this preference won’t (and hasn’t) solve(d) my problem. Again, my problem (or the one I’ve decided to focus on due to an apparently high level of complexity of the matter) being that: I can’t open certain files (that I’ve saved in a directory that isn’t the firefox temp folder) with the apps I want to open them with.

After having said all that and (hopefully) clearing up any and all misunderstandings about the nature of the problem, I pose my inquiry yet again: How do I go about changing the apps firefox considers “default” for certain filetypes?

sexyclient wrote:

> After having said all that and (hopefully) clearing up any and all
> misunderstandings about the nature of the problem, I pose my inquiry yet
> again: How do I go about changing the apps firefox considers “default”
> for certain filetypes?

There is a trick. At least it works for me (openSUSE 10.3 and kde 3.5).

In my case, firefox was using “as default” app for opening pdf
files “kghostscript” and I wanted “kpdf”.

I openned “/usr/share/applications/defaults.list” and searched for "any
application to handle pdfs. There was no one defined there so I edited that
file by adding at the bottom:


application/pdf=kpdf.desktop


Then, I copied “kpdf.desktop” file from “/opt/kde3/share/applications”
to “/usr/share/applications” and restarted firefox.

After that, the default application to handle pdf is now kpdf.

Just give it a try and check if that works for you :-). As you are using kde
4.3 you’ll have to adapt the path for the files but the essence is the
same.

BTW, there are some bugzilla reports in Firefox bugzilla for this same
thing. It’s a bit annoying the way firefox manages mimetypes. Hope
developers change this soon.

Greetings,


Camaleón

Swee-hee-heet!

I’m finally going to make firefox do my bidding! Although I agree that the way to go about doing it is quite annoying, at the moment I’m more than content with the ability to change it.

I’m off to change things right now, thanks a million!!

After snooping a bit, I came up with a little solution that I think is perfect:

In the directory “usr/share/applications/” there are two files, “defaults.list” and “mimeinfo.cache”. I just made defaults.list (which is actually a link to “/var/cache/gio-2.0/defaults.list”) point to mimeinfo.cache because unlike defaults.list, the mimeinfo.cache also has kde apps and contains all of the correct apps for handling different filetypes – except in different order (it just couldn’t be perfect…) I just rearranged the order of the apps (ie: putting ktorrent first from the left, and transmission to the right of it) and now everything is perfect!!

I don’t know what other effects my changes (pointing the defaults.list to mimeinfo.cache) may have, or even why there are so many “lists” that contain different apps to handle different filetypes. There are: (1)defaults.list, which contains only gnome apps, (2)mimeinfo.cache, which contains all the gnome and/or kde apps that I’ve set to handle different mimetypes but oddly rearranged in a manner that favors gnome apps, and (3)the actual list that KDE uses…

Now all that’s left is to find (3) and point all others to it and the universe will find it’s balance…

sexyclient wrote:

> After snooping a bit, I came up with a little solution that I think is
> perfect:
>
> In the directory “usr/share/applications/” there are two files,
> “defaults.list” and “mimeinfo.cache”. I just made defaults.list (which
> is actually a link to “/var/cache/gio-2.0/defaults.list”) point to
> mimeinfo.cache because unlike defaults.list, the mimeinfo.cache also has
> kde apps and contains all of the correct apps for handling different
> filetypes – except in different order (it just couldn’t be perfect…)
> I just rearranged the order of the apps (ie: putting ktorrent first from
> the left, and transmission to the right of it) and now everything is
> perfect!!
>
> I don’t know what other effects my changes (pointing the defaults.list
> to mimeinfo.cache) may have, or even why there are so many “lists” that
> contain different apps to handle different filetypes. There are:
> (1)defaults.list, which contains only gnome apps, (2)mimeinfo.cache,
> which contains all the gnome and/or kde apps that I’ve set to handle
> different mimetypes but oddly rearranged in a manner that favors gnome
> apps, and (3)the actual list that KDE uses…
>
> Now all that’s left is to find (3) and point all others to it and the
> universe will find it’s balance…

I see you found a better way to handle this. Congrats! :wink:

Remember that Firefox is more a gnome-like app (gtk based) so it prefers as
default the gnome applications unless any mysterious magic comes into
place… I mean, I really don’t know the “magic” behind the scenes that FF
uses to select one or another application for the default mimetypes.

P.S. Sorry for the response delay. I’ve just seen this message right now
(7/6/2009 20:44 GMT +0200) as it was a nntp little outage :slight_smile:

Greetings,


Camaleón

You could’ve not replied at all, but it still couldn’t counter the massive impact your help has caused. Thanks again my fellow chameleon-ite!!

On another note, though, this gtk/gnome firefox for KDE business (and the annoying side-effects of it, such as is the case here) is quite annoying… I just can’t wait until the qt firefox port (Qt Port of Mozilla and Firefox 3) gets done. Though I haven’t heard anything about it lately, I’m still holding my breath for a release sometime soon.

Thank You!
I’ve been looking for the files that mozilla (FF) is getting it’s information from.
For at least 2-3 years the only answer I ever got or seen was the lame Preferences > Applications rutine.
I knew there had to be something other than KDE > File Associations too.

*fyi, this worked for me in openSuSE 12.2 / KDE 4.8.5

Again, Thank You.
Landis.