all.js fix

This commit is contained in:
skysthelimitt 2023-10-30 23:03:38 -04:00
parent 08f1f45e0c
commit 8bd6b08c63

View File

@ -75,9 +75,18 @@ const head = document.getElementsByTagName("head")[0];
document.addEventListener( document.addEventListener(
"DOMContentLoaded", "DOMContentLoaded",
function () { function () {
setCloak(); if (window.jQuery) {
console.log("jquery found");
panicMode();
} else {
var jquery = document.createElement("script"); var jquery = document.createElement("script");
jquery.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"; jquery.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js";
document.head.append(jquery);
jquery.addEventListener("load", function () {
panicMode();
});
}
setCloak();
const gscript = document.createElement("script"); const gscript = document.createElement("script");
gscript.setAttribute("async", ""); gscript.setAttribute("async", "");
gscript.setAttribute("src", "https://www.googletagmanager.com/gtag/js?id=G-XVTVBR1D5V"); gscript.setAttribute("src", "https://www.googletagmanager.com/gtag/js?id=G-XVTVBR1D5V");
@ -88,37 +97,22 @@ document.addEventListener(
gtag('config', 'G-98DP5VKS42');`; gtag('config', 'G-98DP5VKS42');`;
const cryptojs = document.createElement("script"); const cryptojs = document.createElement("script");
cryptojs.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"); cryptojs.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js");
document.head.append(gscript, ingscript, jquery, cryptojs); document.head.append(gscript, ingscript, cryptojs);
}, },
false false
); );
defer(function () {
panicMode();
});
function defer(method) {
if (window.jQuery) {
console.log("jquery found.");
panicMode();
} else {
setTimeout(function () {
defer(method);
}, 50);
}
}
let announce; let announce;
let read = 0; let read = 0;
checkannouncements(); checkannouncements();
// checkblock(); // checkblock();
setInterval(() => { setInterval(() => {
// checkblock(); // checkblock();
if (read == 0) { if (read == 0) {
checkannouncements(); checkannouncements();
} }
}, 150000); }, 150000);
async function checkannouncements() { async function checkannouncements() {
if (!read) { if (!read) {