Using KDE dialogs in Firefox and Thunderbird

As you may have guessed I use both GNU/Linux ([Debian](http://www.debian.org)) and [Firefox](http://ww.getfirefox.com) at work and home. Within Debian I use the KDE desktop and for some time it has bugged me no end that firefox (and Thunderbird for that matter) use the GTK dialogs (as used in GNOME. Now there’s nothing wrong with these per-se but what bugs me is that I choose to use KDE and therefore pretty much all my desktop applications use the typical KDE open, save and print dialog boxes – except Firefox and thunderbird and try as I might I couldn’t find a way to switch them over….

Until now…

[Kde – How To: integrate Firefox with KDE – Ubuntu Forums](http://ubuntuforums.org/showthread.php?t=110353)

Above is a link to a [Ubuntu](http://www.ubuntu.org) forum (Ubuntu is another GNU/Linux distribution based on Debian) which explains how to get firefox to use the KDE dialogs. It works a treat and can be transposed to Thunderbird as well.
For those who don’t want to hop over there – or in case the post isappears in the future, here’s the relevant details…

1. Find the system-wide firefox components directory. For Debian it is /usr/lib/firefox/components.
2. Edit the file called nsFilePicker.js in that directory (you may need to be root)
3. Find the following piece of code


compMgr.registerFactoryLocation(FILEPICKER_CID,
"FilePicker JS Component",
// *really long comment here*
"",
// *really long comment here*
fileSpec,
location,
type);

4. Edit it to look like this


compMgr.registerFactoryLocation(FILEPICKER_CID,
"FilePicker JS Component",
// *really long comment here*
FILEPICKER_CONTRACTID,
// *really long comment here*
fileSpec,
location,
type);`

5. Save the file

6. You’ll now need to refresh the firefox chrome registry which is easiest done by installing or removing an Extension (Look under the tools menu) and restarting firefox.

That’s it. If you want to make similar changes to Thunderbird edit the nsFilePicker.js file in the thunderbird components directory (in Debian this is /usr/lib/thunderbird/components/”).

On restarting firefox the standard GTK open, save and print dialogs are all replaced by the typical KDE ones for your system. Incidentally this also resolves a problem with firefox defaulting to letter size paper for printing (not good if you’re not in the USA).