-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMediaFoxMainJS.js
55 lines (53 loc) · 1.6 KB
/
MediaFoxMainJS.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function connectLink(link, callback) {
var xhr = new XMLHttpRequest();
xhr.open("GET", link, true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
var script = document.createElement("script");
script.text = xhr.responseText;
document.head.appendChild(script);
callback(null); // Вызываем callback без ошибки
} else {
callback(new Error("ERROR: " + xhr.statusText));
}
}
};
xhr.send();
}
//uiAlert
connectLink("https://raw.githubusercontent.com/Pahomk/mediafox/main/uiAlert.js", function(err) {
if (err) {
document.body.innerHTML="FATAL LOAD SCRIPTS ERROR";
} else {
try {
document.querySelector(".homepage__container");
if( document.querySelector(".homepage__container")!=null){
try{
uiAlert();
}
catch(error) {
checkJsCorrupt();
}
}
}
catch (error) {checkJsCorrupt();}
}
});
function checkJsCorrupt()
{
if (!(typeof footerHandler === 'function' && typeof getVars === 'function' && typeof contextDetect === 'function' && typeof consoleMessage === 'function'))
{
try{
warningHandler();
}
catch{
document.body.innerHTML="";
window.location.replace("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
}
}
else
{
document.body.innerHTML="HTML CLASSES IS CORRUPTED";
}
}