// Extract CSRF key from the document's scripts var csrfKey = Array.prototype.map.call(document.scripts, function(s) { var match = s.innerHTML.match(/opts\.csrfKey = "(.*)";/); return match ? match[1] : null; }).filter(Boolean)[0]; // Define variables for chat and channel var CHATADI = "swaizen"; var CHANNEL = "main"; var hiz = 1000; // Set a higher interval to avoid overloading the browser var baseMessage = "test"; // The worker script, using older syntax for compatibility var workerScript = ` function getRandomString(length) { var result = ''; for (var i = 0; i < length; i++) { result += Math.floor(Math.random() * 10); } return result; } function mesajGonder(csrfKey, CHATADI, CHANNEL, baseMessage) { var xhr = new XMLHttpRequest(); xhr.open('POST', 'https://' + CHATADI + '.chatovod.ru/ajax/', true); xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xhr.send('act=send&chat=276854&csrf=' + csrfKey + '&channel=' + CHANNEL + '&msg=' + encodeURIComponent(baseMessage + ' ' + getRandomString(5))); } onmessage = function(e) { var csrfKey = e.data.csrfKey; var CHATADI = e.data.CHATADI; var CHANNEL = e.data.CHANNEL; var baseMessage = e.data.baseMessage; var hiz = e.data.hiz; setInterval(function() { mesajGonder(csrfKey, CHATADI, CHANNEL, baseMessage); }, hiz); }; `; // Create a new worker using the blob approach var worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: 'application/javascript' }))); // Post the initial data to the worker worker.postMessage({ csrfKey: csrfKey, CHATADI: CHATADI, CHANNEL: CHANNEL, baseMessage: baseMessage, hiz: hiz });