diff --git a/html/app.js b/html/app.js
index 1d29bf08..c638f31b 100644
--- a/html/app.js
+++ b/html/app.js
@@ -1044,7 +1044,11 @@ function renderInfo(){
if(v==null||v==="")return;
tb.appendChild(h("tr",null,[h("td",{class:"mut",text:t(r[0])}),h("td",{class:"mono",text:String(v)})]));
});
- if(S.info.hostname)$("brandname").textContent=$("brandname").title=S.info.hostname;
+ if(S.info.hostname){
+ $("brandname").textContent=$("brandname").title=document.title=S.info.hostname;
+ // Remembered per switch (each has its own origin) for the login page tab
+ try{localStorage.setItem("rtl_host",S.info.hostname);}catch(e){}
+ }
if(S.info.sw_ver)$("fver").textContent="RTLPlayground "+S.info.sw_ver;
}
function pollInfo(){
diff --git a/html/login.html b/html/login.html
index 9490f77a..042a5c45 100644
--- a/html/login.html
+++ b/html/login.html
@@ -92,8 +92,12 @@ button:hover{filter:brightness(1.1)}
try{l=localStorage.getItem("rtl_lang");}catch(e){}
if(!L[l])l=(navigator.language||"en").slice(0,2);
var s=L[l]||L.en;
- document.title=s[0];
- document.getElementById("hn").textContent=s[0];
+ // Name the tab after the switch: the hostname seen at the last login here,
+ // otherwise the address, so several open switches can be told apart
+ var host=null;
+ try{host=localStorage.getItem("rtl_host");}catch(e){}
+ document.title=(host||location.hostname)+" – "+s[0];
+ document.getElementById("hn").textContent=host||s[0];
document.getElementById("sub").textContent=s[1];
document.getElementById("lp").textContent=s[2];
document.getElementById("lb").textContent=s[3];