diff --git a/src/backend/drivers/workers/WorkerDriver.ts b/src/backend/drivers/workers/WorkerDriver.ts index 044aafe30b..b98ba7b7fb 100644 --- a/src/backend/drivers/workers/WorkerDriver.ts +++ b/src/backend/drivers/workers/WorkerDriver.ts @@ -249,6 +249,13 @@ export class WorkerDriver extends PuterDriver { }); } + if (appId) { + await this.services.fs.mkdir(actor.user.id!, { + path: `/${actor.user.username}/AppData/${appId}`, + createMissingParents: true, + }); + } + // Deploy to Cloudflare const cfResult = await this.#cfDeploy( workerName, diff --git a/src/worker/template/puter-portable.template b/src/worker/template/puter-portable.template index 832c975559..c41831771c 100644 --- a/src/worker/template/puter-portable.template +++ b/src/worker/template/puter-portable.template @@ -29,6 +29,8 @@ globalThis.init_puter_portable = (auth, apiOrigin, type) => { goodContext.ServiceWorkerGlobalScope = ServiceWorkerGlobalScope; goodContext.location = new URL('https://puter.work'); goodContext.addEventListener = () => {}; + goodContext.atob = globalThis.atob?.bind(globalThis); + goodContext.btoa = globalThis.btoa?.bind(globalThis); // @ts-ignore with (goodContext) { #include "../../puter-js/dist/puter.js"