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.