Added support for JS callbacks