Hack 40. Integrate Firefox with Other Tools 
Juggle all your info tools from Firefox with
cross-application integration features.
If you're moving over to Firefox from Mozilla,
you've surely noticed how Firefox is built to be a
sleeker, faster browsing engine. It accomplishes this in part by
shedding all of its counterparts from the Mozilla Suite, including an
email/news client, composer, and chat client. But that
doesn't mean this functionality is no longer
available. With a few extensionsor with no work at
allyou can make Firefox integrate with your email client as
though it were still part of a suite. You don't have
to stop there, either; at least one valuable extension gives you the
power to connect Firefox with virtually any program on your
system.
4.9.1. Integrate Email and News
Firefox does not include a mail client: this functionality has been
outsourced to its cousin, Thunderbird. However, a quick glance at
some of the menu options might make you think the Firefox developers
didn't get that
memo:
- File
Send Link
-
For emailing the current URL
- Tools
New Message
-
For composing a new email message (Windows only)
- Tools
Read Mail
-
For opening your mail client to read new messages (Windows only)
In addition to these menu items, there are frequent mailto: or news: links on the Web that should allow you
to send an email message or read a newsgroup. Firefox contains just
enough glue to pass all these potential actions on to another
program.
The good news is that if you have a default mail program set up on
your operating system, all of these functions will integrate
seamlessly with that program without any additional work. (The
process for defining a default mail program varies according to
operating system.)
If you are running Firefox on Unix/Linux and you
don't have a default mail program set up on Linux,
or if you want Firefox to use a different program, you can integrate
Firefox with your mail program by setting the following preferences:
network.protocol-handler.external.mailto /* set to true, no default */
network.protocol-handler.app.mailto
/* set to filepath, no default */
For example, if you want Linux Firefox to launch Thunderbird when you
click on a mailto: link, set the
network.protocol-handler.app.mailto preference to
the following filepath, if that happens to be where
Thunderbird's startup program is located:
/usr/local/bin/thunderbird/thunderbird
To do the same thing for links that use the news:,
snews:, or nntp: protocols,
verify that the following preferences are set to
true:
network.protocol-handler.external.news
network.protocol-handler.external.snews
network.protocol-handler.external.nntp
Then, set one or more of these matching preferences to the name of
your newsreader:
network.protocol-handler.app.news
network.protocol-handler.app.snews
network.protocol-handler.app.nntp
Another option for handling mailto: links is to
use the Launchy extension, as discussed in Section 4.9.4,
later in this hack.
If you prefer to use a web mailer, such as Gmail or Hotmail,
there's a solution for that, too. The Webmailcompose
extension (http://jedbrown.net/mozilla/) allows you to
override the behavior of mailto: links by
directing you to a web mail provider of your choice. It also replaces
the various mail-related menu options with a list of supported
services from which you can choose.
4.9.2. Integrate Email Message Counts
On Windows operating systems, there are two additional items under
the Tools menu: Read Mail and New Message. The New Message button
will start a new message in your default mail client (or whatever
client you have chosen to override the default), just as though you
had clicked on a mailto: link with no recipient.
The Read Mail option does the same thing, except that it also
displays how many new unread messages you have. That might seem
curious, given that Firefox has no mail functionality of its own.
Figure 4-18 shows these options.

In fact, you might find that it indicates you have 125 new messages,
but you've already checked and are sure you
don't. Or maybe it reads "(0
new)," even when you know you have unread mail
waiting for you.
The problem here is that Firefox is not actually checking to see if
you have new mail but rather is relying on Windows to provide this
information. More specifically, Firefox is looking in the Windows
Registry for the key
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UnreadMail.
If the key exists, it queries the MessageCount
registry property for the default mail account (or the first one that
is listed if there is no default). This property is updated by mail
utilities such as Outlook Express. It is not used by Thunderbird or
other third-party mail clients. Therefore, the text in the Tools menu
will be accurate only if your mail client tells Windows this
information on a regular basis.
4.9.3. Integrate IRC
If you're a fan of Chatzilla, the native IRC client
for Mozilla, you'll be happy to know
it's only a click away. The Chatzilla extension for
Firefox (http://update.mozilla.org, under the Chat
category) will provide you with the same functionality, sidebar and
all.
4.9.4. Integrate Everything Else with Launchy
The
Launchy
extension (http://gemal.dk/mozilla/launchy.html), shown
in Figure 4-19, is a veritable Swiss Army knife when
it comes to integrating Firefox with other programs. It provides you
with a new context menu for pages, links, and images, giving you the
ability to open these items in any of dozens of recognized external
programs. On Windows, these programs are all discovered
automatically, but you can customize the list and even add your own
on any operating system.

Launchy is an ideal way to handle all kinds of integration points
that are otherwise unavailable in Firefox. For instance, if you want
to edit the current web page, you can use the Launchy context menu to
send the page source to Mozilla Composer or NVu. If
you're on a page with an extremely large image, you
can send it to Photoshop for better viewing or editing with a single
click.
If you're forced to use a web site that has the
audacity to only work in Internet Explorer, perhaps the best feature
of Launchy is its ability to send the page straight to Internet
Explorerbut hopefully, this won't ever happen
to you!
Keith M. Swartz
 |