title: How to change selenium user agent in selenium-webdriver nodejs land?
body: <p>I'm in javascript + mocha + node land.</p>
  
  <p>I have tried setting userAgent and 'user-agent' as keys on capabilities:</p>
  
  <pre><code>var webdriver = require('selenium-webdriver');
  var ua = 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X)';
  
  var driver = new webdriver.Builder().
       ...
       withCapabilities({ 'browserName': 'firefox',
          userAgent: ua,
          'user-agent': ua,
      }).
      build();
  </code></pre>
  
  <p>There is <a href="https://stackoverflow.com/questions/17998162/how-to-change-user-agent-in-selenium-with-net">this answer</a> which says to use a firefox profile, but that's not exposed. There is no <code>driver.FirefoxProfile</code> nor one exposed globally nor <code>webdriver.FirefoxProfile</code> nor <code>driver.profiles</code> etc.</p>
  
  <p>I have tried Googling and looking <a href="https://code.google.com/p/selenium/source/browse/javascript/webdriver/webdriver.js" rel="nofollow noreferrer">the source</a> and <a href="https://code.google.com/p/selenium/wiki/WebDriverJs" rel="nofollow noreferrer">the documentation</a> but there is nothing on this.</p>