I\'d like to suppress the initialization of TinyMCE inside my tests and can do this easily if the JavaScript can detect that I\'m running inside a Selenium-automated page.
Since the question mentions Capybara, here's the equivalent code in Ruby:
profile = Selenium::WebDriver::Firefox::Profile.new profile['general.useragent.override'] = "my ua string" driver = Selenium::WebDriver.for :firefox, :profile => profile