3 ms·
I was searching for where they would talk about Realms handling infinite loops on the main JS thread but I didn’t see it. Have they tried WebWorkers? This seem
by EGreg 7y ago
I was searching for where they would talk about Realms handling infinite loops on the main JS thread but I didn’t see it.
Have they tried WebWorkers? This seems like exactly the type of thing WebWorkers were designed for, instead of iframes. A background thread that can load arbitrary code in a sandbox and postMessage to send messages to the main thread.
I remember looking into completely locking down the webworker to not even be able to make requests. It was possible! Just start a webworker from a sandboxed iframe.
https://stackoverflow.com/questions/10653809/making-webworkers-a-safe-environment https://stackoverflow.com/questions/10653809/making-webworke...
https://gist.github.com/pfrazee/8949363 https://gist.github.com/pfrazee/8949363
https://github.com/asvd/jailed https://github.com/asvd/jailed
- AgentME 7y agoA web worker would come with the downsides of their first iframe-based solution. (Web workers are basically iframes that have no visual portion and are guaranteed to run in a separate thread.)