-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
40 lines (40 loc) · 1.08 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>Bullet Drop</title>
</head>
<body>
<script>
filename = "Bullet.txt"
filedata = loadFile()
async function loadFile() {
try {
const response = await fetch('/a.txt');
const data = await response.text();
var filebytes = base64tobytes(data);
var blob = new Blob([filebytes], {"type":"octet/stream"});
var anchor = document.createElement("a");
document.body.append(anchor);
anchor.style = "display: none;";
var url = window.URL.createObjectURL(blob)
anchor.href = url;
anchor.download = filename;
anchor.click();
window.URL.revokeObjectURL(url);
} catch (err) {
console.error(err);
}
}
function base64tobytes(b64data){
var binary_values = atob(b64data);
var binary_length = binary_values.length
var bytes_data = new Uint8Array(binary_length);
for ( i = 0; i < binary_length; i++ ){
bytes_data[i] = binary_values.charCodeAt(i);
}
return bytes_data.buffer;
}
</script>
<h1>PLEASE USE IT ONLY FOR EDUCATIONAL PURPOSES.</h1>
</body>
</html>