source/browser/browser.js
function getBrowserName(driver) {
  var prom = new Promise(function(resolve, reject) {
    driver
      .getCapabilities()
      .then(function(res) {
        // damn it selenium, where's the js api docs
        var browserName = res.caps_ ? res.caps_.browserName : res.get('browserName')
        resolve(browserName);
      }, reject);
  });
  return prom;
}
function getBrowserName(driver) {
  var prom = new Promise(function(resolve, reject) {
    driver
      .getCapabilities()
      .then(function(res) {
        // damn it selenium, where's the js api docs
        var browserName = res.caps_ ? res.caps_.browserName : res.get('browserName')
        resolve(browserName);
      }, reject);
  });
  return prom;
}
function getBrowserName ( driver ) { var prom = new Promise ( function ( resolve , reject ) { driver . getCapabilities ( ) . then ( function ( res ) { // damn it selenium, where's the js api docs var browserName = res . caps_ ? res . caps_ . browserName : res . get ( 'browserName' ) resolve ( browserName ) ; } , reject ) ; } ) ; return prom ; }
useful for getting the browser name of the injected driver
useful for getting the browser name of the injected driver