BUG: Window.location.hostname can have bad values


Window.location.hostname may get stuck on being blank, an IP address, or a URL instead of the correct HiFi domain name.

To reproduce: two avatars; teleport one to a different domain; quickly double-click avatar’s name in users.js list to TP to them.

Run a script with the following:

print("hostname = \"" + Window.location.hostname + "\"");

You’ll likely see that value reported is blank, a numerical IP address, or a text URL, instead of the proper HiFi domain name. And it stays this value even if you run the script again.

The location in Interface’s title bar may also not be the proper HiFi domain name.


Yeah - this is same bug that makes the values in users.js bad. I’ll look into this tomorrow.


@ctrlaltdavid I merged an API fix that at least fixes the issue I was seeing where you would jump to a user in a place and then it wouldn’t look like you were actually in that place.

Can you test this bug you’re describing and let me know if it is fixed?


@b @birarda Unfortunately, I can still reproduce the bug. … Two avatars in hq. Teleport one to sandbox. In the other’s users.js list, double-click on the teleported avatar’s name before it changes to the new hostname. … I ended up with hostname == “” and “sandbox.highfidelity.io” in my Interface title bar (Windows build 2146). And my avatar is listed in users.js without a domain.


@ctrlaltdavid - I’m getting an Invalid domain name error from your regex on line 294.

It’s saying ERROR: Invalid domain name: Heron

Not sure why as that’s, well, valid.


@OmegaHeron Thanks. That’s a separate issue. I’ve just published a fixed chat.js.


Thanks! Much appreciated.


@ctralaltdavid - I still can’t send text. It won’t let me send it out.


@OmegaHeron Check the domain name in your Interface titlebar: if it’s blank or a URL or IP address, chat.js won’t work because of the hostname bug. (Also make sure you’ve got the latest chat.js - I recommend running it direct from the URL so you always pick up the latest.)


Thanks - trying that now. I had downloaded latest interface to be sure it was nothing to do with using self compiled version. Going back to see if my title bar is correct etc. And I am running from your URL.



Window title shows OmegaHeron @ Heron (build dev)
script console:

Text in input area won’t send.


@OmegaHeron Come over to sandbox. Can you do IRC chat?


Okay - I see the issue you are experiencing - investigating.


Alright - have a pull up with a fix for this.

We were double sending location update when changing to a new domain, and one of them didn’t respect the presence of place information. Sorry for the bug!


@birarda Your PR’s in Windows build 2147 and it looks good! Nice and snappy. No more bad values. Thanks. : )