I was having an issue with KDE 4.2 & firefox. If I put
in System Settings / Default Applications / Web Browser, I would get the page downloaded to /var/temp/kdecache-username/krun and then the file opened in firefox.
I tried several options. One suggestion which lined up with how x-chat opened URLs was to use
firefox -remote "openURL(%u, new-tab)"
firefox -remote "openURL(%u, new-tab)" || firefox -new-tab "%u".
The first option didn’t work at all and the second option opened two new tabs in firefox with the link. This was progress, but it still wasn’t what I wanted.
I finally stumbled on what appears to be the solution. I tried
and it worked as desired.