@joernroeder `script.js` serializes the globals and api across a socket to the sandboxed subprocess. As a result, I don't think this globals trick will work. Is the addition of multiple methods still useful to you?