From 5b2cffbd0050da7855219568af988971b7e969f9 Mon Sep 17 00:00:00 2001 From: Gaspard Jankowiak Date: Sat, 6 Jun 2026 21:34:58 +0200 Subject: [PATCH] tweaks --- content.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content.js b/content.js index 51bf310..b3e06f7 100644 --- a/content.js +++ b/content.js @@ -55,7 +55,7 @@ async function downloadApplicantFilesWithProgress(applicantDetails, token, onPro throw `Failed to download file ${afile.file_id} for applicant ${applicantDetails.id}` } - afile.bytes = await response.bytes() + afile.bytes = new Uint8Array(await response.arrayBuffer()) completedDownloads += 1 downloadedBytes += afile.bytes.length onProgress({ downloaded: completedDownloads, total: files.length, bytes: downloadedBytes }) @@ -128,7 +128,7 @@ async function getApplicants() { function sanitizeZipPathSegment(value, fallback = "unnamed") { const sanitized = String(value ?? "") - .replace(/[\/\\:*?"<>|]/g, "_") + .replace(/[\/\\:*?"<>| ]/g, "_") .trim() return sanitized === "" ? fallback : sanitized @@ -291,7 +291,7 @@ async function createZipBlob(archiveEntries) { console.log(archiveEntries) return new Promise((resolve, reject) => { - fflate.zip(archiveEntries, { level: 0, consume: true }, (error, data) => { + fflate.zip(archiveEntries, { mem: 9, level: 0, consume: true }, (error, data) => { if (error != null) { reject(error) return @@ -527,6 +527,7 @@ function rip(event) { archiveEntries["fflate.min.js"] = viewerFflateSource console.log("Generating zip archive...") + createZipBlob(archiveEntries) .then((zipBlob) => { console.log("Zip archive is ready.")