Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

custom protocol handler

117 views
Skip to first unread message

Mitch Claborn

unread,
Jun 15, 2009, 11:51:16 AM6/15/09
to dev-apps-t...@lists.mozilla.org
How can I define a custom protocol handler in Thunderbird to call an
external program when a specially formatted link is clicked in an HTML
email?

I generate some HTML reports that are emailed. I want to have clickable
links in the reports that will take various actions on a web server
without opening a browser. My thought was to create a link like
abcd://localhost:9999/do_something
so that when user clicks the link it will call the external program
which can do whatever I want (like a wget to call the webserver). So I
need to somehow tell Thunderbird to call a specific external program to
handle the abcd protocol.

Any ideas?

Mitch


Dan Mosedale

unread,
Jun 15, 2009, 1:21:25 PM6/15/09
to dev-apps-t...@lists.mozilla.org
On 6/15/09 8:51 AM, Mitch Claborn wrote:
> My thought was to create a link like
> abcd://localhost:9999/do_something
> so that when user clicks the link it will call the external program
> which can do whatever I want (like a wget to call the webserver). So I
> need to somehow tell Thunderbird to call a specific external program to
> handle the abcd protocol.
>
> Any ideas?
>

Thunderbird just asks the OS about protocol handlers, so you need to
have your program register itself as a handler for a specific URL scheme
with the appropriate system service API in Windows, OS X, or GNOME.

Dan

Ben Bucksch

unread,
Jun 15, 2009, 5:38:11 PM6/15/09
to Mitch Claborn, dev-apps-t...@lists.mozilla.org

As dmose said, TB looks at the OS for URL schemes it doesn't know, like
abcd:. In Windows, it's in the registry, next to the file extensions.

Ben Bucksch

unread,
Jun 15, 2009, 5:38:11 PM6/15/09
to Mitch Claborn, dev-apps-t...@lists.mozilla.org
On 15.06.2009 17:51, Mitch Claborn wrote:

As dmose said, TB looks at the OS for URL schemes it doesn't know, like

Mitch Claborn

unread,
Jun 16, 2009, 11:02:53 AM6/16/09
to dev-apps-t...@lists.mozilla.org
Here is what worked for me (Linux / Suse)

gconftool-2 -s /desktop/gnome/url-handlers/mmmm/command 'mm_launch_app
%s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/mmmm/enabled --type Boolean true
gconftool-2 -s /desktop/gnome/url-handlers/mmmm/needs_terminal --type
Boolean false

gconftool-2 -a /desktop/gnome/url-handlers/mmmm

0 new messages