improve detect js

Signed-off-by: TomWu <phperwuhan@gmail.com>