I don't think this would be hard to do. In fact, it would be great if it was a plugin. I would like to call a JS function, passing X number of arguments to it.
If there isn't a way at the moment, I request this :)
Develop games in your browser. Powerful, performant & highly capable.