diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-10-30 10:57:03 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-10-30 10:57:03 +1100 |
commit | 61b9f824f44a52a89acd720efda71c9182639204 (patch) | |
tree | 2b43b59468dada53949edf9a9207d6ca2928d9be /assets/client_test | |
parent | client patcher: discordstatus.com -> status.understars.dev (diff) | |
download | server-61b9f824f44a52a89acd720efda71c9182639204.tar.xz |
Added fast connect to index
Diffstat (limited to 'assets/client_test')
-rw-r--r-- | assets/client_test/index.html | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/assets/client_test/index.html b/assets/client_test/index.html index 1a41da72..7306db60 100644 --- a/assets/client_test/index.html +++ b/assets/client_test/index.html @@ -38,31 +38,16 @@ HTML_TIMESTAMP: Date.now(), ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0" }; - // GLOBAL_ENV.MEDIA_PROXY_ENDPOINT = location.protocol + "//" + GLOBAL_ENV.CDN_HOST; - // TODO: remote auth - // window.GLOBAL_ENV.REMOTE_AUTH_ENDPOINT = window.GLOBAL_ENV.GATEWAY_ENDPOINT.replace(/wss?:/, ""); window.localStorage.setItem("gatewayURL", window.GLOBAL_ENV.GATEWAY_ENDPOINT); window.localStorage.setItem( "DeveloperOptionsStore", `{"trace":false,"canary":false,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}` ); - - /* - // Not required because slowcord has its own login server - setInterval(() => { - var token = JSON.parse(localStorage.getItem("token")); - if (token) { - var logincss = document.querySelector('#logincss'), - canRemove = logincss ? logincss: ""; - if(canRemove !== "") { - document.querySelector("#logincss").remove(); - canRemove = ""; - } - } - }, 1000) - */ </script> + <!-- fast connect --> + <script>!function () { if (null != window.WebSocket) { if (function (n) { try { var e = localStorage.getItem(n); return null == e ? null : JSON.parse(e); } catch (n) { return null; } }("token") && !window.__OVERLAY__) { var n = null != window.DiscordNative || null != window.require ? "etf" : "json", e = window.GLOBAL_ENV.GATEWAY_ENDPOINT + "/?encoding=" + n + "&v=" + window.GLOBAL_ENV.API_VERSION + "&compress=zlib-stream"; console.log("[FAST CONNECT] connecting to: " + e); var o = new WebSocket(e); o.binaryType = "arraybuffer"; var t = Date.now(), i = { open: !1, identify: !1, gateway: e, messages: [] }; o.onopen = function () { console.log("[FAST CONNECT] connected in " + (Date.now() - t) + "ms"), i.open = !0; }, o.onclose = o.onerror = function () { window._ws = null; }, o.onmessage = function (n) { i.messages.push(n); }, window._ws = { ws: o, state: i }; } } }();</script> + <!-- preload plugin marker --> </head> |