LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Open URLs from Thunderbird in Firefox (http://www.linuxquestions.org/questions/linux-software-2/open-urls-from-thunderbird-in-firefox-297242/)

digitalhead 03-03-2005 02:35 PM

Open URLs from Thunderbird in Firefox
 
I have posed this question to the MozillaZine forums with no progress, so I figured I would try here. I am using Slackware 10.0, and when I click on a link in Thunderbird, it does nothing. I need to know how to tell Thunderbird to point URLs to Firefox so I don't have to copy/paste or drag/drop the URL. I have tried a user.js script in the profile directories for both....

Firefox:
Code:

user_pref("network.protocol-handler.app.mailto","/usr/bin/thunderbird");
Thunderbird:
Code:

user_pref("network.protocol-handler.app.http", "/usr/bin/firefox");
user_pref("network.protocol-handler.app.https", "/usr/bin/firefox");
user_pref("network.protocol-handler.app.ftp", "/usr/bin/firefox");


I was also informed about this...
Quote:

From MozillaZine Knowledge Base

Configure each external program to pass the URL to this Bourne shell script:

Code:

#!/bin/sh
#
# This script allows external apps to open new URLs in Firefox
# or open a new instance of Firefox if it isn't already started
#
/path/to/firefox/firefox -a firefox -remote "openURL($@,new-tab)" ||
exec /path/to/firefox/firefox "$@";

This shell script takes advantage of the Mozilla IPC protocol to either open the external URL in an already active Firefox instance, or start a new instance of Firefox.
I have no idea how to implement this though. If anybody knows how to make this work, or if there's another way for my links to work, please let me know.

david_ross 03-04-2005 02:04 PM

The script I use is /usr/local/bin/fftab:
Code:

#!/bin/sh

export MOZILLA_FIVE_HOME="/opt/firefox/current"

url="$1"
if [ ! "$url" ]; then
  url="about:blank"
fi

if $MOZILLA_FIVE_HOME/mozilla-xremote-client -a firefox openURL\("$url",new-tab\); then
  exit 0
fi

$MOZILLA_FIVE_HOME/firefox "$url"

exit 0

Then in your thunderbird prefs.js file add:
user_pref("network.protocol-handler.app.ftp", "/usr/local/bin/fftab");
user_pref("network.protocol-handler.app.http", "/usr/local/bin/fftab");
user_pref("network.protocol-handler.app.https", "/usr/local/bin/fftab");

digitalhead 03-04-2005 02:13 PM

I'm guessing I should replace "/opt/firefox/current" with "/usr/local/firefox/firefox" if that's where I have Firefox installed?

I understand the prefs.js script you mentioned, but what all would I have to alter to suit my settings from the fftab script?

david_ross 03-04-2005 02:18 PM

You should just need to set /opt/firefox/current to the directory you have firefox installed to.

Also remember to make the script executable:
chmod 755 /usr/local/fftab

The other thing to note is that thunderbird must be closed before making changes to the prefs.js file.

digitalhead 03-04-2005 02:50 PM

Still no luck. Added the settings exactly as listed except changed fftab's "/opt/firefox/current" to '/usr/local/firefox" and also tried "/usr/local/firefox/firefox" to point to the actual executable for Firefox. Also made the fftab script executable like you said, and removing the user.js scripts I created earlier just to make sure that didn't effect it.

digitalhead 03-04-2005 03:02 PM

Okay, solved this problem by trying this code in the fftab just to see if it worked, and it did!

Code:

#!/bin/sh
#
# This script allows external apps to open new URLs in Firefox
# or open a new instance of Firefox if it isn't already started
#
/usr/local/firefox/firefox -a firefox -remote "openURL($@,new-tab)" ||
exec /usr/local/firefox/firefox "$@";

Maybe this will help somebody else too. :D

-digitalhead

Optimistic 03-04-2005 04:03 PM

Great tips here.

Thank you!


All times are GMT -5. The time now is 07:14 PM.