Show HN: Duktape-eval – a eval library built on Duktape and WebAssembly
github.com
github.com
Figma has a series of blog posts on sandboxing Javascript in the browser for their plugins API:
https://www.figma.com/blog/how-we-built-the-figma-plugin-sys...
https://www.figma.com/blog/an-update-on-plugin-security/
tl;dr they use QuickJS via WebAssembly at the moment.
But yes, outside of escapes like that, it should be safe to run arbitrary JS via this mechanism.