add support for evironments and global javascript settings