port command.js to browser.