2

Is there a way to make Firefox accept bash commands to handle an application protocol?

Currently, I am opening irc:// links in XChat from Firefox via a shell script as described in this answer. I would like to eliminate the script step and directly move on to opening the link in XChat.

Oxwivi
  • 17,589
  • 53
  • 136
  • 197
  • Can you please give an example of what you're trying to achieve? – arrange Sep 09 '11 at 15:33
  • Well, I do not understand how the command itself will make a difference to the way to get Firefox to run it, but edited in the thing I command I want to run. – Oxwivi Sep 09 '11 at 16:41

2 Answers2

1

You said you wanted to skip the shell script part. Basically you can execute the content of every shell skript like this:

bash -c "contents of shell script in one line"

In your case it would look like this:

bash -c "xchat --existing --url=\"%s\""

Since xchat is an executable independet of bash you should be able to start xchat directly:

/usr/bin/xchat --existing --url="%s"

Use which xchat to find out where xchat is installed on your system and replace the /usr/bin part if it is installed somewhere else.

Lesmana
  • 18,126
  • 8
  • 52
  • 49
  • Yes, I know the command itself (and it's `/usr/bin/xchat` by the way), but what I want to know is how to get Firefox to actually take commands instead just the path to directory. – Oxwivi Sep 11 '11 at 08:15
0

Please see this old post, it helped other people before: http://www.linuxquestions.org/questions/linux-software-2/how-to-register-irc-protocol-to-firefox-browser-283057/

P.S.: read the entire thread.

scrat.squirrel
  • 243
  • 1
  • 9
  • I already tried that suggested in a Ubuntu Forums thread. No luck. – Oxwivi Sep 09 '11 at 19:15
  • Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – RolandiXor Sep 17 '11 at 16:52