Launching Links in Opera from Command Line

I’m an Opera user but I use a number of applications from the command line, and often I want to launch links from those applications into my web browser. I’ve just switched over to reading my feeds using canto (web applications are becoming decreasingly accessible these days, although I’m saving that rant for another day) which is a console-based application. This, like many other applications, allows you to specify a URL handler to use when you want to visit links.

To launch a link into a new tab in an existing Opera window, I simply used this:
opera --remote 'openURL(<url>, new-page)'

Where the <url> is the address to access; the same trick works in other programs too. For example I use irssi for IRC, with the openURL plugin, and this can do the same trick. To launch the link I simply set the http handler like this:
/set openurl_app_http opera --remote 'openURL($1, new-page)'

Since I have to look these settings up every time I want them, I thought I’d blog them for next time – and of course for anyone else who finds this useful between now and then!

2 thoughts on “Launching Links in Opera from Command Line

  1. I popped back to check how to do this, and am experimenting with using chrome (with keyboard navigation). The command for that is: google-chrome [url]

  2. Here it is for the mac (charting my journey through technology and tools)

    /set openurl_app_http open -g -a /Applications/Google\ Chrome.app/ “$1”

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.