I'm not sure at this moment what DE the OP is using, but for the sake of this post, I'll assume you're using some combination of Xfce and/or KDE for the DE and the apps you use.
Previously (Slack 11) I used KDE, but currently I'm using Xfce but I still use Konqueror, Kwrite, and other KDE apps sometimes.
Here's a bunch of stuff I came up with, in not really any particular order, all of which has to do with how Firefox deals with MIME types and opening external applications.
Info: I can't clearly distinguish between the functions of the about
:config entries, versus what's contained in the ~/.mozilla/firefox/<your-profile>/mimeTypes.rdf file, and how each or both of them influence how external content is handled. So, I'll just provide all possible information here, and everyone can do what they like with it
Before deciding to do anything at all, based on what I write here, please read the entire post. There appears to be (as usual) more than one way to skin this fox.
NOTE #1: To see or change the action that Firefox 3.5+ takes, when encountering content that it has ALREADY ENCOUNTERED once, you can use Edit -> Preferences -> Applications. The stuff you see in there, corresponds to the "mimeTypes.rdf" file, which will be discussed below. This stuff gets configured when you use the dialog box "Select application to open this with".
Section 1: Make FF use KDE apps to open stuff:
(there's surely a way to do a similar thing with Xfce apps, but I haven't looked into it; maybe someone else can add that section.)
Create yourself a script; I call mine
kfmclientexecscript4FF and place it in /usr/bin.
Here's what goes in it:
Code:
#!/bin/bash
/usr/bin/kfmclient exec $1
exit 0
That script will be called by Firefox when it wants to use an external KDE application. One really handy thing that this does, is allows you to "Open Containing Folder" when you right-click an item in your Firefox downloads list. It also allows FF to call PDF applications, text editors, etc., when you want to open a downloaded item with an appropriate application.
In order for the above to work, you need to make a few entries in
about:config as follows:
Code:
network.protocol-handler.expose.file (boolean) true
network.protocol-handler.external.file (boolean) true
network.protocol-handler.app.file (string) /usr/bin/kfmclientexecscript4FF
There. Now FF can open containing folder of downloaded items, and can (hopefully) make intelligent choices about what apps to use to open downloaded items.
NOTE: I tested this with some PDF files, a text file, and opening my downloads folder, and they all work fine, however (at least with Xfce) the freshly opened application does not come to focus above the browser, as I would like & expect it to, despite configuring the Xfce settings manager to "Give newly opened windows focus". Maybe it's because they're KDE applications I'm using instead of Xfce apps, I don't know, but if you find a work-around or solution for this, I'd like to know about it
References:
open containing folder under linux
Gentoo WIKI page which no longer exists
Section 2: MIME-Type information:
Slackware does not seem to include a file called /etc/mimetypes which is referenced in the firefox
about:config page. However, I
was able to find a nice, fully stocked mime type file located at /usr/share/mime/types, and also a local file in my home folder called ~/.local/share/mime/types, but in order for Firefox to be aware of these files, you need to edit an about
:config entry (here are FOUR entries, two for MIME-types, and two for mailcap files):
Code:
helpers.private_mailcap_file (string)
helpers.global_mailcap_file (string) /etc/mailcap
helpers.global_mime_types_file (string) /usr/share/mime/types
helpers.private_mime_types_file (string) ~/.local/share/mime/types
Note: The mailcap file I referenced here, on my system, is pretty sparse. It is as follows:
Code:
# Torrent download:
application/x-bittorrent; /usr/bin/bittorrent-xterm '%s' ;
# Java Web Start:
application/x-java-jnlp-file; /usr/lib64/java/bin/javaws %s ;
Doing a search on your machine will turn up several other samples/examples of mailcap configurations. Surely a Google search will also turn up loads of other stuff you can put in there. Basically this file lists MIME-Types, and the application you want associated with them.
As for the mime-type files, my local one is a lot shorter than the one in /usr/share/... but you should probably have similar ones on your system.
Section 2-B: ~/.mozilla/firefox/<your-profile>/mimeTypes.rdf:
This file seems to be where firefox stores its own configuration of what to do with various MIME-types, like what application to use for them. Maybe if it dosn't have something in here for a particular MIME-type, it looks in the mailcap file(s), or vice versa. The way I see it, the more information you provide to the browser, the better it might be able to deal with external content.
Initially, on my Slack64-13 install, the file is 4.3Kib in size. However, I grabbed the one from my last Slack-11 Firefox, and found it to be 14.0 Kib. So, I copied the old one into the place of the new one. Here it is, if you want to use it (close your browser completely, backup your file, and replace mimeTypes.rdf with this file):
Code:
<?xml version="1.0"?>
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<RDF:Seq RDF:about="urn:mimetypes:root">
<RDF:li RDF:resource="urn:mimetype:application/force-download"/>
<RDF:li RDF:resource="urn:mimetype:application/x-bittorrent"/>
<RDF:li RDF:resource="urn:mimetype:application/x-java-jnlp-file"/>
<RDF:li RDF:resource="urn:mimetype:application/zip"/>
<RDF:li RDF:resource="urn:mimetype:message/rfc822"/>
<RDF:li RDF:resource="urn:mimetype:application/x-gzip"/>
<RDF:li RDF:resource="urn:mimetype:application/x-tar"/>
<RDF:li RDF:resource="urn:mimetype:application/pdf"/>
<RDF:li RDF:resource="urn:mimetype:application/postscript"/>
<RDF:li RDF:resource="urn:mimetype:application/msword"/>
<RDF:li RDF:resource="urn:mimetype:application/x-bzip2"/>
</RDF:Seq>
<RDF:Description RDF:about="urn:mimetype:handler:application/postscript"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/postscript"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/postscript"
NC:prettyName=""
NC:path="" />
<RDF:Description RDF:about="urn:handler:web:https://www.mibbit.com/?url=%s"
NC:prettyName="Mibbit"
NC:uriTemplate="https://www.mibbit.com/?url=%s" />
<RDF:Description RDF:about="urn:scheme:handler:irc"
NC:alwaysAsk="true">
<NC:possibleApplication RDF:resource="urn:handler:web:https://www.mibbit.com/?url=%s"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:application/force-download"
NC:fileExtensions="iso"
NC:description=""
NC:value="application/force-download"
NC:editable="true">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/force-download"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:handler:application/force-download"
NC:useSystemDefault="false"
NC:handleInternal="false"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/force-download"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:handler:application/x-bzip2"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-bzip2"/>
</RDF:Description>
<RDF:Description RDF:about="urn:schemes">
<NC:Protocol-Schemes RDF:resource="urn:schemes:root"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:application/x-bittorrent"
NC:fileExtensions="torrent"
NC:description=""
NC:value="application/x-bittorrent"
NC:editable="true">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-bittorrent"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:handler:application/x-bittorrent"
NC:useSystemDefault="false"
NC:handleInternal="false"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-bittorrent"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/force-download"
NC:path="/opt/kde/bin/kget"
NC:prettyName="kget" />
<RDF:Description RDF:about="urn:scheme:handler:webcal"
NC:alwaysAsk="true">
<NC:possibleApplication RDF:resource="urn:handler:web:http://30boxes.com/external/widget?refer=ff&url=%s"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:application/msword"
NC:value="application/msword"
NC:editable="true"
NC:fileExtensions="doc"
NC:description="">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/msword"/>
</RDF:Description>
<RDF:Description RDF:about="urn:handler:web:http://compose.mail.yahoo.com/?To=%s"
NC:prettyName="Yahoo! Mail"
NC:uriTemplate="http://compose.mail.yahoo.com/?To=%s" />
<RDF:Description RDF:about="urn:handler:web:http://30boxes.com/external/widget?refer=ff&url=%s"
NC:prettyName="30 Boxes"
NC:uriTemplate="http://30boxes.com/external/widget?refer=ff&url=%s" />
<RDF:Description RDF:about="urn:scheme:mailto"
NC:value="mailto">
<NC:handlerProp RDF:resource="urn:scheme:handler:mailto"/>
</RDF:Description>
<RDF:Description RDF:about="urn:scheme:ircs"
NC:value="ircs">
<NC:handlerProp RDF:resource="urn:scheme:handler:ircs"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:application/x-gzip"
NC:value="application/x-gzip"
NC:editable="true"
NC:fileExtensions="gz"
NC:description="gzip">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-gzip"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:handler:application/x-java-jnlp-file"
NC:alwaysAsk="true"
NC:saveToDisk="false"
NC:useSystemDefault="false"
NC:handleInternal="false">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-java-jnlp-file"/>
</RDF:Description>
<RDF:Description RDF:about="urn:scheme:folder"
NC:value="folder">
<NC:handlerProp RDF:resource="urn:scheme:handler:folder"/>
</RDF:Description>
<RDF:Description RDF:about="urn:handler:web:https://mail.google.com/mail/?extsrc=mailto&url=%s"
NC:prettyName="Gmail"
NC:uriTemplate="https://mail.google.com/mail/?extsrc=mailto&url=%s" />
<RDF:Description RDF:about="urn:mimetypes">
<NC:MIME-types RDF:resource="urn:mimetypes:root"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:application/x-java-jnlp-file"
NC:fileExtensions="jnlp"
NC:description="Java Web Start"
NC:value="application/x-java-jnlp-file"
NC:editable="true">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-java-jnlp-file"/>
</RDF:Description>
<RDF:Description RDF:about="urn:root"
NC:en-US_defaultHandlersVersion="3" />
<RDF:Description RDF:about="urn:mimetype:message/rfc822"
NC:value="message/rfc822"
NC:editable="true"
NC:fileExtensions="eml"
NC:description="RFC-822 data">
<NC:handlerProp RDF:resource="urn:mimetype:handler:message/rfc822"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-bzip2"
NC:prettyName=""
NC:path="" />
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-gzip"
NC:prettyName=""
NC:path="" />
<RDF:Description RDF:about="urn:mimetype:handler:application/zip"
NC:useSystemDefault="false"
NC:handleInternal="false"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/zip"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/zip"
NC:path="/opt/kde/bin/kget"
NC:prettyName="kget" />
<RDF:Description RDF:about="urn:mimetype:handler:application/x-gzip"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-gzip"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/pdf"
NC:prettyName=""
NC:path="" />
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-tar"
NC:prettyName=""
NC:path="" />
<RDF:Description RDF:about="urn:scheme:handler:mailto"
NC:alwaysAsk="true">
<NC:possibleApplication RDF:resource="urn:handler:web:https://mail.google.com/mail/?extsrc=mailto&url=%s"/>
<NC:possibleApplication RDF:resource="urn:handler:web:http://compose.mail.yahoo.com/?To=%s"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/msword"
NC:prettyName=""
NC:path="" />
<RDF:Description RDF:about="urn:mimetype:application/zip"
NC:fileExtensions="zip"
NC:description=""
NC:value="application/zip"
NC:editable="true">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/zip"/>
</RDF:Description>
<RDF:Description RDF:about="urn:handler:local:/usr/bin/kwrite"
NC:prettyName="kwrite"
NC:path="/usr/bin/kwrite" />
<RDF:Description RDF:about="urn:mimetype:handler:message/rfc822"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:message/rfc822"/>
</RDF:Description>
<RDF:Description RDF:about="urn:scheme:externalApplication:file"
NC:prettyName="kwrite"
NC:path="/usr/bin/kwrite" />
<RDF:Description RDF:about="urn:mimetype:application/x-tar"
NC:value="application/x-tar"
NC:editable="true"
NC:fileExtensions="sig"
NC:description="">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-tar"/>
</RDF:Description>
<RDF:Description RDF:about="urn:scheme:file"
NC:value="file">
<NC:handlerProp RDF:resource="urn:scheme:handler:file"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:externalApplication:message/rfc822"
NC:prettyName=""
NC:path="" />
<RDF:Seq RDF:about="urn:schemes:root">
<RDF:li RDF:resource="urn:scheme:webcal"/>
<RDF:li RDF:resource="urn:scheme:mailto"/>
<RDF:li RDF:resource="urn:scheme:irc"/>
<RDF:li RDF:resource="urn:scheme:ircs"/>
<RDF:li RDF:resource="urn:scheme:file"/>
</RDF:Seq>
<RDF:Description RDF:about="urn:mimetype:application/pdf"
NC:value="application/pdf"
NC:editable="true"
NC:fileExtensions="pdf"
NC:description="">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/pdf"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-java-jnlp-file"
NC:path="/home/Sasha/Applications/bin/azureus/azureus"
NC:prettyName="azureus" />
<RDF:Description RDF:about="urn:scheme:handler:file"
NC:alwaysAsk="false">
<NC:possibleApplication RDF:resource="urn:handler:local:/usr/bin/kwrite"/>
<NC:externalApplication RDF:resource="urn:scheme:externalApplication:file"/>
</RDF:Description>
<RDF:Description RDF:about="urn:scheme:irc"
NC:value="irc">
<NC:handlerProp RDF:resource="urn:scheme:handler:irc"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-bittorrent"
NC:path="/home/Sasha/Applications/bin/azureus/azureus"
NC:prettyName="azureus" />
<RDF:Description RDF:about="urn:scheme:handler:ircs"
NC:alwaysAsk="true">
<NC:possibleApplication RDF:resource="urn:handler:web:https://www.mibbit.com/?url=%s"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:handler:application/msword"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/msword"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:application/x-bzip2"
NC:value="application/x-bzip2"
NC:editable="true"
NC:fileExtensions="bz2"
NC:description="">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-bzip2"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:application/postscript"
NC:value="application/postscript"
NC:editable="true"
NC:description="Postscript File">
<NC:fileExtensions>ps</NC:fileExtensions>
<NC:fileExtensions>eps</NC:fileExtensions>
<NC:fileExtensions>ai</NC:fileExtensions>
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/postscript"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:handler:application/x-tar"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-tar"/>
</RDF:Description>
<RDF:Description RDF:about="urn:scheme:webcal"
NC:value="webcal">
<NC:handlerProp RDF:resource="urn:scheme:handler:webcal"/>
</RDF:Description>
<RDF:Description RDF:about="urn:mimetype:handler:application/pdf"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/pdf"/>
</RDF:Description>
</RDF:RDF>
NOTE: In the above file, in places where you see
NC:alwaysAsk="false" you can change that to "true" and it will cause Firefox to pop up a dialog box, asking what you want to do for that action. The dialog box will have a check-box for "Remember my setting for this" or some such thing, which will make the dialog pop-up NOT appear from that point on, if you check it.
Section 3: Miscellaneous:
Finally: I did a diff of my old Slack-11 FF's prefs.js file against the new FF 3.5.3 prefs.js file, and discovered a lot of differences. Of course this is to be expected generally, but I haven't taken the time to examine every change and see if anything in the old file has anything to do with external content, yet is missing from the new file.
Prefs.js is for the most part, where your about
:config entries are stored.
You can edit the file, with the browser closed!! The browser re-writes the file when it closes, so close the browser first before editing the file.
If you want to delete entries from the file, you can just un-set them in about
:config, and close the browser. They will then be gone.
Best of luck; if anyone has more to add, especially info about launching external Xfce or other DE applications from FF, or more entries to put in our mailcap files, please post away!
More references:
IANA's official MIME media types
WIKIpedia list of Common Media Types
MozillaZine File types & Download Actions
Have fun!
Sasha