Articles: How to use Firefox from external applications
As for Windows, Mac OS X and some desktop environments on GNU/Linux you would simply set a default browser for the system. However there is also a manual way of setting this option.
Added: 2005-01-02 17:34:59 - Modified: 2006-09-23 23:20:54 - Level: Intermediate
![]()
Recommend this article to a friend.
Toggle more
The actual script is as follows
#!/bin/bash
export MOZILLA_FIVE_HOME="/home/kristianf/Applications/firefox/current"
url="$1"
if [ "x$url" = "x" ]; then
url="about:blank"
else
url=http://${url##http://};
url=${url/http:\/\/https:\/\//https:\/\/}
fi
if $MOZILLA_FIVE_HOME/mozilla-xremote-client -a openURL\("$url"\); then
exit 0
fi
exec $MOZILLA_FIVE_HOME/firefox "$url"
How to use it
Mozilla Thunderbird
user_pref("network.protocol-handler.app.http","/home/kristianf/Applications/firefox_remote.sh");
user_pref("network.protocol-handler.app.https","/home/kristianf/Applications/firefox_remote.sh");
If you don't have this file in your profile directory, then create it. it itsn't there by default. As you see this file set a new protocol handeler, in this case to a shell-script making use of Mozilla's xremote procedure. The shell-script in my case look like:
X-Chat
To use it from X-Chat you would add the following to urlhandlers.conf
NAME Browser
CMD !/home/kristianf/Applications/firefox_remote.sh "%s"
As always, comments and how to do it in other applications as well are welcome.
Related articles:
[Sitemap]

