Implement adding viewer by JS.