From d57cd783ac664c95c5d915d9399033c671c1bfbb Mon Sep 17 00:00:00 2001 From: The Arcane Brony Date: Wed, 20 Oct 2021 17:54:54 +0200 Subject: Add plugin & css support, add styling to differentiate from discord.com --- api/client_test/index.html | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'api/client_test/index.html') diff --git a/api/client_test/index.html b/api/client_test/index.html index 92499034..2ff0b469 100644 --- a/api/client_test/index.html +++ b/api/client_test/index.html @@ -4,6 +4,10 @@ Discord Test Client + + + + @@ -38,12 +42,33 @@ ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0" }; GLOBAL_ENV.MEDIA_PROXY_ENDPOINT = location.protocol + "//" + GLOBAL_ENV.CDN_HOST; + const localStorage = window.localStorage; + // TODO: remote auth + // window.GLOBAL_ENV.REMOTE_AUTH_ENDPOINT = window.GLOBAL_ENV.GATEWAY_ENDPOINT.replace(/wss?:/, ""); + localStorage.setItem("gatewayURL", window.GLOBAL_ENV.GATEWAY_ENDPOINT); + localStorage.setItem( + "DeveloperOptionsStore", + `{"trace":false,"canary":false,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}` + ); + + + const token = JSON.parse(localStorage.getItem("token")); + if(token) { + document.querySelector("#logincss").remove(); + } + + const settings = JSON.parse(localStorage.getItem("UserSettingsStore")); + if (settings && settings.locale.length <= 2) { + // fix client locale wrong and client not loading at all + settings.locale = "en-US"; + localStorage.setItem("UserSettingsStore", JSON.stringify(settings)); + } - + -- cgit 1.4.1