On Chrome, you can do this by going to: Settings -> Security and Privacy -> Site Settings -> Javascript
For Safari, go to: Safari -> Preferences -> Security -> Enable Javascript