1
0
This commit is contained in:
Zef Hemel 2022-10-17 15:56:47 +02:00
parent 7d1a04f392
commit c2ccd2a6a1

View File

@ -46,7 +46,24 @@ export function createSandbox(plug: Plug<any>) {
workerHref, workerHref,
{ {
type: "module", type: "module",
}, deno: {
permissions: {
// Allow network access and servers (main use case: fetch)
net: true,
// This is required for console loggin to work, apparently?
env: true,
// No talking to native code
ffi: false,
// No invocation of shell commands
run: false,
// No read access to the file system
read: false,
// No write access to the file system
write: false,
},
},
// Have to do this because the "deno" option is not standard and doesn't typecheck yet
} as any,
); );
return new Sandbox(plug, new DenoWorkerWrapper(worker)); return new Sandbox(plug, new DenoWorkerWrapper(worker));
} }