From b9e47f1c20e4c9caec37c3e83fb3a333bb4ce3ef Mon Sep 17 00:00:00 2001 From: TheEmeraldStarr <46467239+Epicloudygamer@users.noreply.github.com> Date: Mon, 19 Oct 2020 10:02:04 -0700 Subject: [PATCH] Added Chatbox --- public/expr/ch.js | 36 ++++++++++++++++++++++++++++++++++++ public/index.html | 1 + public/n.html | 29 +++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 public/expr/ch.js create mode 100644 public/n.html diff --git a/public/expr/ch.js b/public/expr/ch.js new file mode 100644 index 00000000..61eb1028 --- /dev/null +++ b/public/expr/ch.js @@ -0,0 +1,36 @@ +function $(id) { + return document.getElementById(id); +}; + +//AL +// $('al').onclick = function() { +// document.cookie = '__alloy_cookie_auth=yes; expires=' + (Date.now() + 259200) + '; SameSite=None; domain=.' + auth + '; path=/; Secure;'; +// return false; +//}; + +window.onload = function() { + var url = $('url').value; + var det = document.domain; + var domain = det.replace('www.', '').split(/[/?#]/)[0]; + const origin = btoa(url) + window.location.href = "https://c" + domain + "/app"; + document.cookie = '__chauth=yes; expires=' + (Date.now() + 259200) + '; SameSite=Lax; domain=.' + auth + '; path=/; Secure;'; + return false; +}; + +// Cookie Auth +var host = location.hostname.split('.'); +var auth = location.hostname; +if (host.length == 3) { + auth = `${host[1]}.${host[2]}`; +} + +Array.from(document.getElementsByTagId('button')).forEach(e => { + e.addEventListener('click', () => { + document.cookie = 'session; max-age=259200; SameSite=None; domain=' + auth + '; path=/; Secure;'; + }); +}); + +window.onload = function() { + $('url').focus(); +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index cb595665..c96f42a5 100644 --- a/public/index.html +++ b/public/index.html @@ -39,6 +39,7 @@