Approaches
WorkerBox
Code is run in it's own subdomain of
workerbox.net
Code is run in a WebWorker
Host calls into guest code as async
Partytown
Not for sandboxing, but uses sync XHR hack to call between worker/main synchronously
https://partytown.builder.io/how-does-partytown-work
QuickJS
Run JS in JS
TODO More
iframe
sandbox attr
JS Realms
Caja
Deprecated
Not sure what it did exactly
Resources
How to build a plugin system on the web and also sleep well at night
Show HN: Run unsafe user generated JavaScript in the browser | Hacker News