-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.html
62 lines (54 loc) · 1.82 KB
/
404.html
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
<!DOCTYPE html>
<html lang="en-us">
<head>
</head>
<body>
</body>
<script>
(function() {
redirect();
}());
function redirect() {
var n = window.location.pathname.substr(1);
var request = new XMLHttpRequest();
request.open("GET", "guests.json", false);
request.send(null);
var guests = JSON.parse(request.responseText);
var gameIndex = guests[n];
var game;
if(gameIndex == 0) {
game = "mauro";
} else if(gameIndex == 1) {
game = "ro";
}
if(game) {
if(isOnIOS() || !supportsWasm()) {
window.location.replace("/" + game + "/asmjs");
} else {
window.location.replace("/" + game + "/wasm");
}
} else {
window.location.replace("/tarjeta");
}
}
function isOnIOS() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
return true;
}
return false;
}
function supportsWasm() {
try {
if (typeof WebAssembly === "object"
&& typeof WebAssembly.instantiate === "function") {
const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
if (module instanceof WebAssembly.Module)
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
}
} catch (e) {
}
return false;
}
</script>
</html>