public static void populateInfoFromNavigator(WebDriver webDriver, Client browser) {
    
    String userAgentScript = "var nav = '';" + "try { var myNavigator = {};"
      + "for (var i in navigator) myNavigator[i] = navigator[i];"
      + "nav = JSON.stringify(myNavigator); } catch (exception) { nav = exception.message; }"
      + "return nav;";
    
    if (!browser.shouldGetUserAgent() || !WebDriverUtils.isAlive(webDriver))
      return;
    
    webDriver.get("http://www.google.com");
    Object resultObject = ((JavascriptExecutor) webDriver).executeScript(userAgentScript);
    logger.info("Client platform and userAgent for: " + browser.toString() + "->" + resultObject);
    
    if (resultObject instanceof String) {
      String resultOfScript = (String) resultObject;
//      browser.setUserAgentVersionAndPlatform(resultOfScript);
    }
  }
Populate info from navigator.

@param webDriver the web driver
@param browser   the browser
KITE-Framework/src/main/java/org/webrtc/kite/Utils.java