Compatibility tweaks

- Fix (i hope all) electron issues
- Add complete blah support
- Add userscript
This commit is contained in:
olcxja 2026-05-11 19:22:30 +02:00
commit 7ff648ba3a
19 changed files with 478 additions and 576 deletions

View file

@ -100,7 +100,14 @@
<script>
async function start() {
try {
if (host != null)
{
await updateProtocolAndUrl(host);
}
else
{
await updateProtocolAndUrl(window.location.hostname);
}
showAction("Authenticating...", "startauth");
let res = await Auth(username, password);
@ -108,13 +115,13 @@
if (res.startsWith("success:")) {
await refreshDms();
} else {
showNotification("Failed to auth. Redirecting to login...", "error", 3500);
showBlahNotification("error:auth.failed.redirect.to.login");
await delay(2000);
window.location.href = "login/index.html";
}
} catch (e) {
clearAction("startauth");
showNotification("Failed to auth. Redirecting to login...", "error", 3500);
showBlahNotification("error:auth.failed.redirect.to.login");
await delay(2000);
window.location.href = "login/index.html";
}
@ -131,28 +138,27 @@
}
catch (e) {
clearAction("dmrefresh");
showNotification("Failed to refresh dms", "error", 3500);
showBlahNotification("error:dm.refresh.failed");
}
}
async function addDm() {
try {
showAction("Adding...", "dmadd");
let res = await fetchEncrypted("user/dm/invite", document.getElementById("addchat-username").value);
console.log(res);
let ressplit = res.split(":");
clearAction("dmadd");
showNotification(ressplit[1], ressplit[0], 3500);
showBlahNotification(res);
}
catch (e) {
console.log(e);
clearAction("dmadd");
showNotification("Failed to add chat", "error", 3500);
showBlahNotification("error:chat.add.failed");
}
}
start();
</script>
</script>
<script src="userscript.js"></script>