Make firefox aware of kde apps
Hi, quick question,
Trying out opensuse the other day, I noticed that when downloading (for example) a tar.bz2 in firefox, one option would be to 'open with ark'. This does not happen for me in slackware. I can configure firefox to automatically open archives with ark, but it seems that if I set it to ask me what to do each time, it is not aware of ark as an application. How can I solve this? Thanks a lot john |
About MIME types and .desktop files
For any entity your browser can not render internally it will look for an accompanying MIME type. FF recognises MIME types searching through two databases" (type "about:config" and search for "mime"). Customised handling can then be configured in ~/.mozilla/firefox/$PROFILENAME/mimeTypes.rdf. Recognising applications linked to MIME types is done by your Desktop Environment which should honour the Desktop Entry Specification. It dictates each shared MIME type (also see: XDG) is mapped to a .desktop file in the mimeinfo.cache (and defaults.list) and each relevant application has a .desktop file with a "MimeType" entry in it. So if for instance you're looking for "tar" ("application/x-tar") you could check if 'grep -i 'tar=' mimeinfo.cache' and 'grep -i 'tar=' defaults.list' both point to the same .desktop file and if that file exists if it emits the right MIME types 'grep -i mime'.
* Somebody else may know of a more "correct", easier or even GUI way for handling this kind of thing. |
thanks for the information. If I can decipher what it means then I'll give it a go :p
cheers |
Firefox's about:config points to two files: /etc/mime.types and ~/.mime.types, neither of which are present on a clean Slackware install...
|
Quote:
Unfortunately, I don't think it will completely solve the problem. |
yeah, that extension doesn't really help as far as I can tell. You don't get the option "Open this file with Ark" [pretty icon], just "open this file with:" and nothing. Although if I click okay, it does open in ark. weird stuff. Perhaps I can just copy an /etc/mime.types from opensuse??
john |
Uh. All I'm saying is that maybe how the DE presents a default application for this MIME-type is inconsistent. AFAIK copying mailcap, mime.types or magic.* has *nothing* to do with it since the MIME-type *is* known and a default application *was* offered.
Maybe just read my reply starting at "So if for instance if..." |
It seems to me that the problem is that even though KDE programs know the default apps associated with MIME types, Gtk2 apps like Firefox don't. As figured, Firefox in Xfce doesn't fair any better in these terms.
On Kubuntu, however, Firefox gives a drop down list of apps you can open downloads with in addition to browsing for others. I still don't know how to do this in Slackware (playing with the /usr/share/applications/{defaults.list,mimeinfo.cache} files didn't do anything for me), but at least the MIME Edit extension makes things a little easier. Also, here's another helpful tweak for firefox that makes browsing for the app easier. Enter "about:config" in the address bar, look for the "ui.allow_platform_file_picker" key and change its value to "false". Now you have a more kde friendly file browser in firefox. Have you actually gotten this working for any apps unSpawn? |
Hey i was trying to do this too.
After read the posts and check in "about:config", i copy /etc/mailcap from other distro and if work now i have a list of programs to open with (i tried mime.types before mailcap and didn't work to me), |
Quote:
|
Quote:
Instead of modifying my /etc/mailcap I chose to modify ~/.mailcap. The default path for mailcap is (as found under the man page) Code:
$HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap Code:
application/x-tar;ark %s You have to modify mimeTypes.rdf under your firefox profile first. I found the easiest way to do this is to use the MIME Edit firefox extension. Simply add one entry for each corresponding entry of interest in the mailcap (you don't have to do them all). Now once this is done you should see the default option (ark in this case) come up whenever you try to download or open one of these three archive file types. In addition, if you use the MIME edit extension to specify an alternate program to use for these files, it will now be included as an option. Be sure to check the 'always ask what to do' unless you want the files to be handled automatically. The option selected by default will be the last one selected under the MIME edit extension. Once you are all setup with this you can simply copy the mimeTypes.rdf file to another profile if you desire. |
Quote:
Which mimeinfo.cache file did you edit? I have three different ones located at /home/USERNAME/.local/share/applications/mimeinfo.cache /usr/local/share/applications/mimeinfo.cache /usr/share/applications/mimeinfo.cache I'm assuming you just put the .desktop file in /usr/share/applications. What do you mean by MMMV(VM)? Is it supposed to be an acronym for something or are you just throwing out some Roman Numerals? Even though I already got this working using the mailcap I'm still wondering if there are alternative methods that will work. |
Quote:
In regard to KDE-specific info, for example, /usr/share/applications/defaults.list is apparently not used on KDE (or at least this is the case on Kubuntu, Netrunner, and similar distros). Also /usr/share/applications/mimeinfo.cache is not used. Here are my notes about the KDE files related to mime-types: /etc/mime.types <-- present on Netrunner 4.1, Kubuntu 11.10 and 12.04, etc. /usr/share/applications/mimeinfo.cache <-- NOT present on Netrunner, Kubuntu, etc. /usr/share/applications/defaults.list <-- NOT present on Netrunner, Kubuntu, etc. /etc/mailcap <-- present on Netrunner, Kubuntu, etc. ~/.local/share/applications/mimeapps.list <-- present on Netrunner but NOT on Kubuntu. ~/.mozilla/firefox/<profile>/mimeTypes.rdf <-- present on Netrunner & Kubuntu but the contents appear to differ. Here are the Firefox settings. These KDE settings appear to be different from gnome Firefox settings. Firefox about:config: helpers.global_mime_types_file /etc/mime.types Firefox about:config: helpershelpers.private_mime_types_file ~/.mime.types After tracking down all those files, I'm still missing something. I can't get it to work. What else controls Firefox's recognition of mimetypes in KDE? Firefox works perfectly in Netrunner 4.1 (which is a customization of Kubuntu 11.10). However, Firefox has the problem described in this thread in Kubuntu 12.04b1 (and, I'm told, also in 11.10 proper). I want to fix this in Kubuntu without switching to Netrunner or OpenSuse. Another very closely related problem I want to solve is getting Firefox to "Open Containing Folder" of downloaded items. Since this thread already has good info and a high Google ranking, I would prefer to continue the discussion in this thread. But I also posted a question at Ask Ubuntu: http://askubuntu.com/questions/11219...wnloaded-files |
Hi
I overcome this with xdg-open. In KDE, I tune the apps I want to open each MIME type in Settings -> File association. In Firefox, I browsed to /usr/bin/xdg-open the first time FF asked me what to do with a file it doesn't handle. Now, whichever file Firefox does not handle it opens it with my chosen apps thanks to xdg-open. I have it working since Slackware-13.0 / KDE 4.2 / FF 3.6 up to Slackware64-current / KDE 4.8 / FF 10. Hope it helps Cheers |
OpenSuse and Kubuntu use a package called, you guessed it: firefox-kde-support
Which adds all the nifty mimetypes, makes Firefox use the kde/qt file picker, and other KDE apps. firefox-kde-opensuse - Gitorious - https://gitorious.org/firefox-kde-opensuse/ |
It appears that the firefox-kde-support package is broken right this moment. We're hoping it gets fixed in time for the Kubuntu 12.04 release. Here's the bug report: https://bugs.launchpad.net/ubuntu/+s...er/+bug/949949
However, the xdg-open workaround mentioned by cendryon is a very good solution. It may even be the best way of doing it. Here are the steps from Canonical support: Quote:
|
All times are GMT -5. The time now is 11:59 PM. |