adding dirrectory helper

This commit is contained in:
MathMan05
2025-03-10 11:46:28 -05:00
parent 7c94c45bf5
commit 31fe95b7a4
4 changed files with 134 additions and 40 deletions

View File

@@ -0,0 +1,13 @@
//This is *only* for webkit, and it really sucks
//If webkit starts supporting the more sain way, let me know so I can remove this after a year or two of them supporting it
onmessage = async (e) => {
const [file, content, rand] = e.data as [FileSystemFileHandle, ArrayBuffer, number];
try {
const handle = await file.createSyncAccessHandle();
handle.write(content);
handle.close();
postMessage([rand, true]);
} catch {
postMessage([rand, false]);
}
};