diff options
| author | stonedDiscord <Tukz@gmx.de> | 2022-03-28 21:30:35 +0200 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2022-03-28 21:30:35 +0200 |
| commit | fa175d7b0136cd837942eb54db0c98c4314eaada (patch) | |
| tree | a8c7cb58a5ef162ad92a7188cceaecf09f03002c /webAO/master.ts | |
| parent | 053898d659137d59639b8af881b6958dabda0bb4 (diff) | |
list http links even when coming from a https page
Diffstat (limited to 'webAO/master.ts')
| -rw-r--r-- | webAO/master.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/webAO/master.ts b/webAO/master.ts index a48f4e9..ca129fd 100644 --- a/webAO/master.ts +++ b/webAO/master.ts @@ -132,6 +132,7 @@ function cachedServerlist(response: Response) { } function processServerlist(thelist: { name: string, description: string, ip: string, port: number, ws_port: number, assets: string, online: string }[]) { + const myURL: string = window.location.href.replace('https://','http://'); for (let i = 0; i < thelist.length - 1; i++) { const serverEntry: { name: string, description: string, ip: string, port: number, ws_port: number, assets: string, online: string } = thelist[i]; @@ -142,8 +143,8 @@ function processServerlist(thelist: { name: string, description: string, ip: str if (serverEntry.ws_port) { document.getElementById('masterlist').innerHTML += `<li id="server${i}" onmouseover="setServ(${i})"><p>${safeTags(serverEntry.name)}</p>` - + `<a class="button" href="client.html?mode=watch&ip=${ipport}">Watch</a>` - + `<a class="button" href="client.html?mode=join&ip=${ipport}">Join</a></li>`; + + `<a class="button" href="${myURL}/client.html?mode=watch&ip=${ipport}">Watch</a>` + + `<a class="button" href="${myURL}/client.html?mode=join&ip=${ipport}">Join</a></li>`; } } } |
