asvd / jailed

execute untrusted code with custom permissions
MIT License
1k stars 69 forks source link

Get data from a plugin #4

Closed adngdb closed 9 years ago

adngdb commented 9 years ago

Hello,

I haven't found an answer from reading the doc, and couldn't get my hacks to work, so here's my question. Is it possible to send some data from a plugin to the application?

Here's my use case: I have a data set, and I want users to be able to run some JS to transform that set, then get it back and display it from my main application. Is that possible using jailed?

Thanks, Adrian

asvd commented 9 years ago

So you have the data in an application, and users create a code to work on this data, right?

Then simply transfer the data as an argument for the method exposed by the plugin, and then return the processed data by invoking a callback. Would that work?

adngdb commented 9 years ago

Nice! I got it!

It's not very intuitive though, may I suggest you add some documentation about transferring data between plugin and application? I bet I won't be the only one struggling with that. :)

Congrats for this lib, it's a very nice tool (and as far as my research went, it's unique).

asvd commented 9 years ago

Sure, actually a new issue means for me either a pending feature or the docs update ;-)

(honestly I already have a big list of pending changes for the docs, need to handle those someday)

Thank for the contribution!