Making Firefox use Thunderbird for web feeds

I was saving this tip for today, because it’s a bit of a Christmas present, courtesy of alta88.

Users of both Firefox and Thunderbird may have noticed that when you get the feed preview screen in Firefox 2, and use the drop-down list to add the feed to Thunderbird, it does not work. There are bugs filed for this. One that I know of, is bug 350735.

To make it work, you’ll need to close Firefox, and go into the \components\ folder, in the Firefox program directory. (eg. C:\Program Files\Mozilla Firefox\components ), and open the file FeedConverter.js in a text editor. You had better make a backup of it first. Because of the line breaks, Notepad won’t work; but Wordpad will work.

At around line 332, you’ll see text that looks like:

case "client":
var clientApp =
prefs.getComplexValue(PREF_SELECTED_APP, Ci.nsILocalFile);
//@line 393 "/cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-release/WINNT_5.2_Depend/mozilla/browser/components/feeds/src/FeedConverter.js"
var ss =
Cc["@mozilla.org/browser/shell-service;1"].
getService(Ci.nsIShellService_MOZILLA_1_8_BRANCH);
ss.openApplicationWithURI(clientApp, spec);
break;

Replace that (select, copy, paste) with:

case "client":
const PREF_SELECTED_APP_ARGS = "browser.feeds.handlers.application.args";
const PREF_SELECTED_APP_URIPREFIX = "browser.feeds.handlers.application.uriPrefix";

var clientApp = prefs.getComplexValue(PREF_SELECTED_APP, Ci.nsILocalFile);
var feedhandlerArgs = safeGetCharPref(PREF_SELECTED_APP_ARGS, Ci.nsIILocalFile);
var uriPrefix = safeGetCharPref(PREF_SELECTED_APP_URIPREFIX, Ci.nsIILocalFile);

var file = Cc["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(clientApp.persistentDescriptor);
var process = Cc["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process.init(file);

if (uriPrefix) spec = uriPrefix + spec;
if (feedhandlerArgs)
var args = [feedhandlerArgs, spec];
else
var args = [spec];

process.run(false, args, args.length);
break;

Save and close FeedConverter.js.

Next, open Firefox and use about:config to add the following preferences:
Add the String preference browser.feeds.handlers.application.args.
Set the value to -mail.
Add the String preference browser.feeds.handlers.application.uriPrefix.
Set the value to feed:. (Include the colon.)

Enjoy, and have a merry Christmas. 🙂