JavaScript and Lua in WebView

I want JavaScript and Lua code in a WebView to be able to call each other. Is it better to modify the source code of Solar2D, or to achieve this through a plugin?

Would that work for you?