add support to js plugin, same as code