Sandboxing #108
-
|
Hi, Im currently working on making a game, and I want to support js as a scripting engine. So, I wanted to ask how sandboxable yantra is. In other word, does it have / will it have file access, internet access, stuff like that, because I really don't want that or need to be able to deactivate it. Also, for module resolution, is it possible to overwrite the default behavior? In my case Im using the Godot engine, and it has custom path stuff, like "user://" and "res://". Because of that I would like to manually resolve all modules. Ideally return a string, which is the code of the module. Is that possible? I would really like to use this library, because it seems a lot more modern. My fallback would be jint but there Ill have to hack around a bit regarding the path resolution and async interop with c# isn't optimal. Ps. Have you guys thought about creating a discord? Its much easier to ask questions and chat there, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You can use this method We want to keep public discussion on github so it is picked up by search engines. And we have too many tools already, we prefer mattermost or self hosted tools to manage communication, discord is completely private. |
Beta Was this translation helpful? Give feedback.
@DragonMaster14545
JSModuleContexthas a constructor parameterenableClrIntegrationwhich istrueby default, if you passfalse, then clr access is completely disabled, scripts will only be able to access modules that you explicitly add to the module. There are methods to add your own modules.You can use this method
LoadModuleAsyncinJSModuleContext, which you can override to support your own module loader, however this is undocumented and might change in future, but in that case most likely the signature of method will change but overall logic will remain same.We want to keep public discussion on github so it is picked up by search engines. And we have too many tools already, we prefe…