mirror of
https://github.com/lordfriky/web-cfw-loader.git
synced 2024-12-28 16:11:55 +00:00
Update main.js
This commit is contained in:
parent
d2167a4e34
commit
05dc78255f
20
main.js
20
main.js
@ -109,13 +109,21 @@ document.getElementById("goButton").addEventListener("click", async () => {
|
|||||||
var debugCheckbox = document.getElementById("shouldDebug");
|
var debugCheckbox = document.getElementById("shouldDebug");
|
||||||
const payloadType = document.forms.mainForm.payload.value;
|
const payloadType = document.forms.mainForm.payload.value;
|
||||||
if(debugCheckbox.checked) {
|
if(debugCheckbox.checked) {
|
||||||
if (payloadType === "uploaded") {
|
let payload;
|
||||||
const file = document.getElementById("payloadUpload").files[0];
|
if (payloadType === "fusee.bin") {
|
||||||
file = new Uint8Array(await readFileAsArrayBuffer(file));
|
payload = fusee;
|
||||||
} else if (payloadType === "fusee.bin") {
|
} else if (payloadType === "uploaded") {
|
||||||
const file = fusee;
|
const file = document.getElementById("payloadUpload").files[0];
|
||||||
|
if (!file) {
|
||||||
|
alert("You need to upload a file, to use an uploaded file.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
logOutput(readFileAsArrayBuffer(file));
|
payload = new Uint8Array(await readFileAsArrayBuffer(file));
|
||||||
|
} else {
|
||||||
|
logOutput("You're trying to load a payload type that doesn't exist.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
logOutput(payload);
|
||||||
}
|
}
|
||||||
logOutput("Requesting access to device...");
|
logOutput("Requesting access to device...");
|
||||||
device = await navigator.usb.requestDevice({ filters: [{ vendorId: 0x0955 }] });
|
device = await navigator.usb.requestDevice({ filters: [{ vendorId: 0x0955 }] });
|
||||||
|
Loading…
Reference in New Issue
Block a user