jailed icon indicating copy to clipboard operation
jailed copied to clipboard

Is there any way to import third party node module/lib to sandbox?

Open we-zhang opened this issue 10 years ago • 2 comments

If the loaded code in sandbox requires some dependency/lib, is there any way to import the libs to sandbox for the code to use?

we-zhang avatar Apr 14 '16 23:04 we-zhang

What I do is loading the third party library as text (with webpack, in my case) and inject it in the wrapper code. You can't normally access the DOM or window object, though, at least in the browser, so be prepared to mock stuff :)

cristiano-belloni avatar Apr 16 '16 21:04 cristiano-belloni

And I guess this is a duplicate of https://github.com/asvd/jailed/issues/23

cristiano-belloni avatar Apr 16 '16 21:04 cristiano-belloni