Hacker News new | ask | show | jobs
by attilakun 632 days ago
Do you evaluate JS using a web worker in the browser? https://github.com/quadratichq/quadratic/blob/qa/quadratic-c...

How effective is this as a sandbox, are there any know (security) tradeoffs? I was using QuickJS for my previous projects but I'm wondering if yours is a better solution (it's certainly more performant).

2 comments

This might be of interest https://github.com/asvd/jailed.
Yes, it’s running in a web worker. It still has access to the browser, so running code in the worker has the same privileges as regular workers. The only communication with the main thread is via socket messages.