2023-08-11 20:06:09 +00:00
|
|
|
// @ts-check
|
|
|
|
|
2023-08-02 20:08:17 +00:00
|
|
|
import * as base64 from "../common/vendor/base64-js.js";
|
2023-08-11 20:06:09 +00:00
|
|
|
|
|
|
|
const main = () => {
|
|
|
|
// TODO: We may want a better UI here.
|
2023-08-02 20:08:17 +00:00
|
|
|
// TODO: Handle errors.
|
|
|
|
const fileDataBase64 = window.sessionStorage.getItem("fileData");
|
|
|
|
if (!fileDataBase64) {
|
2023-08-11 20:06:09 +00:00
|
|
|
location.href = "..";
|
|
|
|
return;
|
|
|
|
}
|
2023-08-02 20:08:17 +00:00
|
|
|
const bytes = base64.toByteArray(fileDataBase64);
|
2023-08-11 20:06:09 +00:00
|
|
|
|
|
|
|
console.log(bytes);
|
|
|
|
};
|
|
|
|
|
|
|
|
main();
|