diff --git a/views/assets/js/common-16451543478.js b/views/assets/js/common-16451543478.js index ee946df7..a2bc3a72 100644 --- a/views/assets/js/common-16451543478.js +++ b/views/assets/js/common-16451543478.js @@ -4,66 +4,43 @@ /* MAIN Holy Unblocker LTS Common Script /* ----------------------------------------------- */ -function tryGetElement(id) { - return document.getElementById(id) || {}; -} +// Completely unused for some reason??? +// const tryGetElement = id => document.getElementById(id) || {}; /** * Get the preferred apex domain name. * Not exactly apex, as any subdomain other than those listed will be ignored. **/ -function getDomain() { - return location.host.replace(/^(www|edu|cooking|beta)\./, ""); -} +const getDomain = () => location.host.replace(/^(www|edu|cooking|beta)\./, ""); /* STEALTH FRAME */ -function goFrame(url) { +const goFrame = url => { localStorage.setItem("huframesrc", url); - window.location.href = "?s"; -} + location.href = "?s"; +}; -function goToUrl(url, stealth, nolag) { - if (stealth) { - goFrame(url, nolag); - } else { - window.location.href = url; - } -} +const goToUrl = (url, stealth, nolag) => { + stealth ? goFrame(url, nolag) : location.href = url; +}; /* COOKIE AUTH DEMO */ -function setAuthCookie(s, lax) { - document.cookie = - s + - "; expires=" + - (Date.now() + 259200) + - "; SameSite=" + - (lax ? "Lax" : "None") + - "; domain=." + - getDomain() + - "; path=/; Secure;"; -} +const setAuthCookie = (s, lax) => { + document.cookie = s + `; expires=${Date.now() + 259200}; SameSite=${lax ? "Lax" : "None"}; domain=.${getDomain()}; path=/; Secure;`; +}; /* OMNIBOX */ const sx = "bing.com" + "/search?q="; -function omnibox(url) { - if (url.substring(0, 4) == "http") { - return url; - } else if (url.includes("." || "")) { - return "https://" + url; - } else { - return "https://" + sx + url; - } -} +const omnibox = url => + (url.indexOf("http") + ? "https://" + (url.indexOf(".") < 1 ? sx : "") + : "") + + url; -function uvUrl(url) { - return ( - location.origin + __uv$config.prefix + __uv$config.encodeUrl(omnibox(url)) - ); -} +const uvUrl = url => location.origin + __uv$config.prefix + __uv$config.encodeUrl(omnibox(url)); /* RAMMERHEAD CONFIGURATION */ diff --git a/views/assets/js/csel.js b/views/assets/js/csel.js index 9141d777..a3678aea 100644 --- a/views/assets/js/csel.js +++ b/views/assets/js/csel.js @@ -1,7 +1,7 @@ /* ----------------------------------------------- -/* Authors: OlyB +/* Authors: OlyB and Yoct /* GNU Affero General Public License v3.0: https://www.gnu.org/licenses/agpl-3.0.en.html -/* Adapted and modified by yoct. +/* Adapted and modified by Yoct. /* Settings Menu /* ----------------------------------------------- */ @@ -13,7 +13,7 @@ date = date.toUTCString(); // All cookies should be secure and are intended to work in iframes. const setCookie = (name, value) => { - document.cookie = name + `=${encodeURIComponent(value)}; expires=${date}; SameSite=None; Secure`; + document.cookie = name + `=${encodeURIComponent(value)}; expires=${date}; SameSite=None; Secure;`; }, removeCookie = name => { @@ -48,7 +48,7 @@ pageShowAds = () => { let advertising = document.createElement("style"); advertising.id = "advertising"; advertising.innerText = ".ad { display:block; }"; - document.appendChild.bind(document.head || document.body || document.documentElement || document)(advertising); + (document.head || document.body || document.documentElement || document).appendChild(advertising); }, // Remove the stylesheet made by the function above, if it exists.