Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

URI scheme "secondlife://sim/x/y" in Mozilla/Linux?

Morgaine Dinova
Active Carbon Unit
Join date: 25 Aug 2004
Posts: 968
02-15-2006 11:24
Under Windows, when a URL of the type secondlife://simname/x/y is handed to Mozilla, it launches the SecondLife client and teleports you to the sim <simname> at location x,y.

Does anyone know how we can achieve the same functionality with Mozilla and Firefox under Linux to launch the new Linux alpha client?

Configuring this seems to be automated in the Windows installer of course, but I'd be perfectly happy to configure it by hand under Linux ... if only I knew how. :P

Anyone?

Great work on the native client btw. - Amazingly excellent for an alpha release, well done!!!
_____________________
-- General Mousebutton API, proposal for interactive gaming
-- Mouselook camera continuity, basic UI camera improvements
Feynt Mistral
Registered User
Join date: 24 Sep 2005
Posts: 551
02-15-2006 13:19
Under windows it's a registry entry:
HKEY_CLASSES_ROOT -> secondlife: REG_SZ | URL:Second Life

With the pattern "Type | Value" in the above. And then under that there's:
...-> shell -> open -> command: REG_EXPAND_SZ | "C:\Program Files\SecondLife\SecondLife.exe" -url %1

So it seems to me if you want to have a browser load SL based on a secondlife:// address, you'll need to write a plugin or something to intercept the protocol type and open SL with -url "secondlife://someplace".
_____________________
I dream of a better tomorrow in SL!
You should too. Visit, vote, voice opinions.
Support CSG! Tell LL how much it would mean to subtract one prim from another!
Prim Animation! Stop by and say something about it, show your support!
Aero6 Widget
Registered User
Join date: 10 Feb 2006
Posts: 5
Part of the solution
02-15-2006 20:03
From: Morgaine Dinova

Does anyone know how we can achieve the same functionality with Mozilla and Firefox under Linux to launch the new Linux alpha client?

Configuring this seems to be automated in the Windows installer of course, but I'd be perfectly happy to configure it by hand under Linux ... if only I knew how. :P


Maybe this will help http://kb.mozillazine.org/Register_protocol, though I haven't tried to see if the linux sl client will accept command line arguments.
Elberg Control
Wandering Loon
Join date: 24 Aug 2005
Posts: 79
02-15-2006 22:25
Hmm.... running secondlife-bin --help isn't very forthcoming. This sort of thing could be hacked into gnome-vfs or KDE's equivalent fairly easily, but we kinda gotta know the format for the command-line invocation first.
Aero6 Widget
Registered User
Join date: 10 Feb 2006
Posts: 5
02-15-2006 22:48
secondlife-bin -url secondlife://simname seems to work, but I tried secondlife://Ahern/50/33 and I ended up on Ahern, but not exactly where I expected. Maybe the coordinates aren't in the frame I expected though.
Morgaine Dinova
Active Carbon Unit
Join date: 25 Aug 2004
Posts: 968
Re: URI scheme "secondlife://sim/x/y" in Mozilla/Linux?
02-16-2006 03:43
From: Aero6 Widget
Maybe this will help http://kb.mozillazine.org/Register_protocol, though I haven't tried to see if the linux sl client will accept command line arguments.
Excellent info, thanks Aero6!

Using that guide, I've now got this working perfectly. Here's my mini HOWTO:

1) Type "about:config" (no spaces) in the Mozilla or Firefox URL address box. This displays an internal list of configuration variables and their values.

2) Right-click in the window and select New->Boolean. A requester for "New boolean value" pops up, and you are requested to "Enter the preference name". Type in "network.protocol-handler.external.secondlife". A requester for "Enter boolean value" pops up. Type in "true".

3) Right-click in the window and select another New->Boolean. This time type in "network.protocol-handler.warn-external.secondlife". and give this a value of "true". (As you'll see when you use it, you'll be able to override this setting on first invocation.)

4) Right-click in the window again and this time select New->String. A requester for "New string value" pops up, and you are requested to "Enter the preference name". Type in "network.protocol-handler.app.secondlife". A requester for "Enter string value" pops up. Type in "/usr/local/bin/secondlife", or whatever pathname leads to the client startup script on your system. It is important that this points to the startup script, and not to the client binary.

5) Take a backup copy of the client startup script mentioned above, and then modify the original as follows. Among the various fields on the binary client invocation line, you will find these two fields separated by a space:

bin/secondlife-bin $@


Place a new space-separated field "${1:+-url}" in between those two fields, so that it now looks like this:

bin/secondlife-bin ${1:+-url} $@


What this does is to insert the "-url" flag as an additional first argument if the script is invoked with one or more arguments, but not otherwise. Mozilla (and presumably Firefox) place a secondlife URI on the commandline when the appropriate link is clicked, but won't accept any flags in the app.secondlife string variable ... pity. This script mod compensates for that problem.

And that's it.

Here's a random test link to try it out on, courtesy of GNU Wave Architects. Enjoy. :-)
_____________________
-- General Mousebutton API, proposal for interactive gaming
-- Mouselook camera continuity, basic UI camera improvements
Morgaine Dinova
Active Carbon Unit
Join date: 25 Aug 2004
Posts: 968
02-16-2006 06:09
Specifying a third coordinate in the URL works perfectly too, as you'd expect, ie.

secondlife://sim/x/y/z


That's both elegant and very handy for commuting to your castle high up in the clouds. :-)
_____________________
-- General Mousebutton API, proposal for interactive gaming
-- Mouselook camera continuity, basic UI camera improvements
Hello Toonie
Registered User
Join date: 25 Jul 2005
Posts: 212
02-16-2006 08:31
Thanks Morgaine, that works pretty well!
Angel Sunset
Linutic
Join date: 7 Apr 2005
Posts: 636
any idea how to do that in opera?
02-16-2006 15:18
Hi!

I use opera in windows and linux.

In windows, if I add a new protocol "secondlife", and under "open with" put in second life, then the links in slpics.com open sl to the right destination, if SL is already running. If not, SL gets called up.

In linux, doing the same thing calls up secondlife, but a new instance every time. I have to log in, and then end up at my last location, which is my setting for SL.

Any clues as to how to do this in opera? It seems a) it does not find an already running SL (I use the full path), and b) it is not passing the parameter.

I live in hope... :)

--- Edit ---

Adding the "url" stuff to the secondlife script fixed it :D

Thanks for all the debugging, to enable me to get a quick fix :)

It still opens up a new instance of SL, though... But I can live with that for now.
_____________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kubuntu Intrepid 8.10, KDE, linux 2.6.27-11, X.Org 11.0, server glx vendor: NVIDIA Corporation, server glx version: 1.5.2, OpenGL vendor: NVIDIA Corporation, OpenGL renderer: GeForce 9800 GTX+/PCI/SSE2, OpenGL version: 3.0.0 NVIDIA 180.29, glu version: 1.3, NVidia GEForce 9800 GTX+ 512 MB, Intel Core 2 Duo, Mem: 3371368k , Swap: 2570360k
Morgaine Dinova
Active Carbon Unit
Join date: 25 Aug 2004
Posts: 968
External teleport control for a running client instance
02-17-2006 02:12
From: Angel Sunset
It still opens up a new instance of SL, though... But I can live with that for now.
That's a very good question, Angel. It behaves the same with Mozilla as you report in Opera.

As far as I can see, this is a browser-independent issue.

When we click on a secondlife:// URL, the browser merely invokes some commandline for us and doesn't actually know what will happen when it does so. This is how it should be. Tighter coupling between applications is a recipe for headaches.

Quite separate from that though is what gets done when that commandline is invoked, and this has nothing to do with the browser --- the same thing would apply if the command were typed in by hand, or invoked from a menu that we've set up in our window manager. Currently the script just performs a direct invocation of the client, so not surprisingly a new client instance is what we get. :P

Currently, I know of no way in which an external action (which could be called within the script) can tell a running viewer client "Please teleport my avatar to simname at coordinates x,y,z". This would require a running client to be listening for such UI requests on a communications channel --- not at all hard to do, but we don't have that in the client yet, AFAIAA.

The latter will be needed anyway when the UI becomes locally programmable, which is hinted at every now and then by LL folks but no details ever given. As it's so low down the priority list, my guess is that nothing like this will appear until an open-source system starts to offer realistic competition (we'll be able to add such functionality to it ourselves of course). But by then, it'll be far too late for LL to catch the speeding train.
_____________________
-- General Mousebutton API, proposal for interactive gaming
-- Mouselook camera continuity, basic UI camera improvements
Brian Quinn
It.....
Join date: 9 May 2005
Posts: 31
02-19-2006 07:56
My two cents is your completely accurate that the calling application doesn't realize what will happen when the cl is invoked, however.................. The sl startup script should be aware of the status of it's binary, and if it's already running, simply tp the binary to the requested location. Of course, this could be an option like many other apps currently have, the ability to determine whether you want a new instance, or just simply key the running app to the requested app, alla xmms, winamp, etc
Jay Lamington
Registered User
Join date: 29 Jul 2005
Posts: 6
02-19-2006 22:37
Here's a slight refinement of the very good mini-HOWTO that Morgaine Dinova provided:

From: Morgaine Dinova

4) Right-click in the window again and this time select New->String. A requester for "New string value" pops up, and you are requested to "Enter the preference name". Type in "network.protocol-handler.app.secondlife". A requester for "Enter string value" pops up. Type in "/usr/local/bin/secondlife", or whatever pathname leads to the client startup script on your system. It is important that this points to the startup script, and not to the client binary.


Instead of specifying the normal secondlife startup script, point Firefox to a script which you should create somewhere (I called it slopenurl) with the following contents:

CODE

#!/bin/sh

exec $HOME/bin/secondlife -url "$@"


(Replace $HOME/bin/secondlife with the location of your secondlife startup script. In my setup, that file is actually a wrapper for the unmodified LL-provided startup script which does my LD_PRELOAD appearance fixing hack.) Don't forget to make the script executable: chmod +x slopenurl, adjusted as necessary for your file names and paths. This allows flags to be passed exactly as well as before while also allowing Firefox to use secondlife:// URLs.

I've tested these instructions, and I was able to launch a secondlife:// URL from Firefox on Linux, even without having SL running previously. Morgaine, nice job figuring out most of what had to be done! :-)
KittyFox Mistral
Registered User
Join date: 17 Oct 2005
Posts: 51
02-20-2006 02:10
Anyone have any info on how to do this in KDE/Konqueror? I added a secondlife entry to the uri section in File Associations, but Konqueror still complains its an unsupported protocol.
Hel Jezebel
Registered User
Join date: 21 Jan 2006
Posts: 52
07-04-2006 17:56
From: Morgaine Dinova
Excellent info, thanks Aero6!

Using that guide, I've now got this working perfectly. Here's my mini HOWTO:<snip>
And that's it.

Here's a random test link to try it out on, courtesy of GNU Wave Architects. Enjoy. :-)

Thanks SO much. Works PERFECTLY!
Theora Aquitaine
Registered User
Join date: 12 Feb 2006
Posts: 266
07-05-2006 01:47
Just added this howto to http://stux.wikiinfo.org/moin.py/AlphaClientUnofficialHacks
Jesse Malthus
OMG HAX!
Join date: 21 Apr 2006
Posts: 649
07-05-2006 10:34
So, does anyone care to hack up a quick extention for this?
Ya know, so we don't have to delve into crome to register it.