Chat.js - an interim local chat


Run the following script and you can chat with people on the same domain as you:

Menu item: Tools > Local Chat… shows / hides window.
Or press “” to show and Esc to hide (if the window has focus).
Click on the chat window to give it focus; click elsewhere and it loses focus.
The cursor in the input pane flashes when it has focus.

Press Ctrl+\ to bring up the IRC link window instead.

It’s an interim solution that uses one Web application to service everyone using the script.
It simulates local domain-specific chat by restricting messages sent/received to be on the same domain as you.
It isn’t scalable in its current incantation.
And it isn’t secure or encrypted or anything.


Wonderful work. Try it out, folks!


This topic is now pinned. It will appear at the top of its category until it is either unpinned by a moderator, or the Clear Pin button is pressed.


@ctrlaltdavid - you have done amazing work here but I noticed you used your own server and aspx (IIS).

Will you release the source to your back end script so that it can be converted to php by those of us who want to run a chat for our own domain (yes I know this will require a per domain script if yours is not used but it gives a sense of security for those of us that would like to filter messages through our own server)?

Otherwise, great job!


Yes, the back end is a Web application but it’s only an interim solution to get us alphas by for now. I think releasing the server code would be counterproductive …

The whole point of this exercise is to encourage a universal metaverse-wide basic local chat. Something ephemeral like voice chat as a common means of basic, casual communication for chance encounters and interaction to augment voice chat.

Ideally, in my books, local chat would be a direct correlate of voice:

  • local to domain
  • roll off with distance
  • able to configure to be restricted to areas in the domain
  • able to configure to be propogated further afield in the domain
  • fan out (if necessary) by assignment clients
  • provided as part of Interface + Stack Manager

If High Fidelity can’t be convinced that they should implement local chat then longer term solution approaches include (in order of decreasing ease of use / desirability):

  • Stack Manager script.
  • Stack Mananger assignment client.
  • Domain owner Web application.
  • Externally provided Web application.

Options 1 and 2 are much more desirable than options 3 and 4!


A Comparison Between High Fidelity and Sansar

I’ve updated chat.js to better cope with one’s HiFi domain name not being fully resolved. However, there’s still an Interface bug where Windows.location.hostname gets stuck on being a blank string or an IP address which stops the script working properly. The effect is that you can type a message but not submit it, and you can’t see any other people’s messages. If this happens, teleport away and back again and it should reset Windows.location.hostname and get things working again.


Some bug fixes published. Thanks @OmegaHeron for helping debug.

Still suffers from the Window.location.hostname bug: if the domain in the title bar of Interface is blank, a URL, or an IP address instead of the domain name, teleport away and back again and chatting should work.


The Window.location.hostname bug has been fixed in Windows build 2147 / OSX build 2016. chst.js should work smoothly now.


Is there a repository for this? (github, for eg.)


@mirardo No, my downloads directory is just a place where I put various things for people to download.


@ctrlaltdavid - I have published a preliminary version of the chat options in High Fidelity including your script:


I’ve made a couple of minor fixes, including better handling the “” key so that it doesn’t sometimes pop up the “High Fidelity IRC” Web chat notice when it shouldn’t. (User Ctrl+\ to open this notice instead.)

This updated version is publised at the same URL, i.e., …

If you’re running the script from this URL you’ll automatically get the up to date copy. (You should normally run the script from the URL rather than donloading it and running from a local copy.)


Added instructions, “Esc to close, “” to reopen” to title bar.

Thanks to @HiroProtagonist for the suggestion.


can you make it so we can copy and past in the chat


I’ve created a modified headMove.js so that you don’t unexpectedly turn 180 degrees when typing a chat message:


I’ve added a scrollbar to the local chat.js script.


The ESC key still interferes with the lobby.js :frowning:
And for some reason high fidelity is not remember your running scripts list. so lobby get reloaded with restart. need to make one of this days own startup script.

Can you not use \ for open and close of the chat ?


Hi. Esc works if the chat window has focus (cursor flashing in input pane).


When is chat.js put into the defaultscripts.js offcorse that still don’t solve the problem that you cannot reach someone on not connected sim.

Voice in virtual wworld really have lots and lots of weak spots.


New, Improved Local Chat Interface

I’ve reworked the chat.js script …

When in desktop display mode, the chat is in its own window which can be dragged off screen and resized. You can also paste text into the input pane and copy text from the chat history.

When in HMD display mode, the chat is displayed in an HUD window as before.

The script URL remains the same:

Full description:

Note: You may need to do a “Reload” in the Running Scripts window to refresh your cached copy.