forked from gn-math/html
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path123.html
More file actions
72 lines (69 loc) · 3 KB
/
123.html
File metadata and controls
72 lines (69 loc) · 3 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<base href="https://cdn.jsdelivr.net/gh/genizy/polytrack@main/">
<script>
window.jkdfgnjkndfg = document.querySelector('base').href;
fetch("simulation_worker.bundle.js").then(res => res.text()).then(text => {
const blob = new Blob([text.replaceAll("replacethisplease", window.jkdfgnjkndfg)], {
type: 'application/javascript'
});
window.simulationworker = URL.createObjectURL(blob);
});
const ogworker = window.Worker;
window.Worker = function (scriptUrl, options) {
if (typeof scriptUrl === 'string' && scriptUrl.toLowerCase() === "simulation_worker.bundle.js") {
const wrapper = {};
const promise = window.simulationWorkerReady.then(() => {
const actualWorker = new ogworker(window.simulationworker, options);
Object.assign(wrapper, actualWorker);
if (typeof wrapper.onmessage === 'function') {
actualWorker.onmessage = wrapper.onmessage;
}
return actualWorker;
});
return new Proxy(wrapper, {
get(target, prop) {
return (...args) => {
promise.then(realWorker => realWorker[prop](...args));
};
},
set(target, prop, value) {
promise.then(realWorker => {
realWorker[prop] = value;
});
return true;
}
});
}
return new ogworker(scriptUrl, options);
};
window.Worker.prototype = ogworker.prototype;
const ogfetch = window.fetch;
window.fetch = async function (input, init) {
if (typeof input === "string") {
input = input.replace("vps.kodub.com:43273", "vpskodub.tmena1565.workers.dev");
} else if (input instanceof Request) {
const newUrl = input.url.replace("vps.kodub.com:43273", "vpskodub.tmena1565.workers.dev");
input = new Request(newUrl, input);
}
return ogfetch(input, init);
};
const ogxml = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function (method, url, ...rest) {
if (typeof url === "string") {
url = url.replace("vps.kodub.com:43273", "vpskodub.tmena1565.workers.dev");
}
return ogxml.call(this, method, url, ...rest);
};
</script>
<link rel="manifest" href="manifest.json" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
</head>
<body>
<canvas id="screen"></canvas>
<div id="ui"></div>
<div id="transition-layer"></div>
<script type="module" src="main.bundle.js" defer></script>
</body>
</html>