<commit_before># dalek-driver-chrome - Browser/WebDriver process control

Browser Driver for [Chrome](???) providing an API to control the Browser/WebDriver process, buggyfill the browser's WebDriver capabilities, as well as provide an easy means to install the necessary binaries etc.

## Browser / Driver Documentation

* [Chromedriver Docs](???)

---

## API Documentation

```js
var Browser = require('dalek-driver-chrome');
var browser = new Browser({
  // path to binary
  // default: provided by chrome
  "binary": "/path/to/browser-executable",
  // make the WebDriver instance listen on interface 127.0.0.1
  // default: "127.0.0.1"
  "host": "127.0.0.1",
  // make the WebDriver instance listen on a port between 1111 and 2222
  // default: [2048, 4096]
  "portRange": [1111, 2222],
  // CLI parameters passed to Chrome at startup
  // default: (--port=<host:port> --verbose)
  "args": [
    // see ???
    "--local-to-remote-url-access=true"
  ],
});

function success(data) {
  console.log("Started browser, WebDriver available at", data.wd);
}

// callback invoked when the process could not be started
function error(err) {
  console.log("Could not start Browser", err);
}

// callback invoked when the process crashed
function failure(err) {
  console.log("Browser crashed!", err);
}

// fire up the browser and WebDriver service
browser.start(success, error, failure);

// gracefully stop the browser
browser.stop(function() {
  console.log('stopped!');
});

// force kill the process (in case stop() doesn't work)
browser.kill();
```

a full integration using [WD.js](https://github.com/admc/wd) could look like

```js
var WD = require('wd');
var Browser = require('dalek-driver-chrome');

var wd = wd.promiseChainRemote();
var browser = new Browser({
  name: 'Chrome'
});

browser.start(function(options) {
  // initialize WD client from configuration options
  // provided by the browser driver
  wd.remote(options.wd).then(function() {
    // some fun with WebDriver
  });
}, console.log.bind(console));

// stop WD client, then service and browser
wd.quit().then(function() {
  browser.stop();
});
```
<commit_msg>docs(readme): Add more chrome specific data<commit_after># dalek-driver-chrome - Browser/WebDriver process control

Browser Driver for [Chrome](https://sites.google.com/a/chromium.org/chromedriver/) providing an API to control the Browser/WebDriver process, buggyfill the browser's WebDriver capabilities, as well as provide an easy means to install the necessary binaries etc.

## Browser / Driver Documentation

* [Chromedriver Docs](https://sites.google.com/a/chromium.org/chromedriver/)

---

## API Documentation

```js
var Browser = require('dalek-driver-chrome');
var browser = new Browser({
  // path to binary
  // default: provided by chrome
  "binary": "/path/to/browser-executable",
  // make the WebDriver instance listen on interface 127.0.0.1
  // default: "127.0.0.1"
  "host": "127.0.0.1",
  // make the WebDriver instance listen on a port between 1111 and 2222
  // default: [2048, 4096]
  "portRange": [1111, 2222],
  // CLI parameters passed to Chrome at startup
  // default: (--port=<host:port> --verbose --url-base=/wd/hub/)
  "args": [
    // see http://peter.sh/experiments/chromium-command-line-switches/
    "--local-to-remote-url-access=true"
  ],
});

function success(data) {
  console.log("Started browser, WebDriver available at", data.wd);
}

// callback invoked when the process could not be started
function error(err) {
  console.log("Could not start Browser", err);
}

// callback invoked when the process crashed
function failure(err) {
  console.log("Browser crashed!", err);
}

// fire up the browser and WebDriver service
browser.start(success, error, failure);

// gracefully stop the browser
browser.stop(function() {
  console.log('stopped!');
});

// force kill the process (in case stop() doesn't work)
browser.kill();
```

a full integration using [WD.js](https://github.com/admc/wd) could look like

```js
var WD = require('wd');
var Browser = require('dalek-driver-chrome');

var wd = wd.promiseChainRemote();
var browser = new Browser({
  name: 'Chrome'
});

browser.start(function(options) {
  // initialize WD client from configuration options
  // provided by the browser driver
  wd.remote(options.wd).then(function() {
    // some fun with WebDriver
  });
}, console.log.bind(console));

// stop WD client, then service and browser
wd.quit().then(function() {
  browser.stop();
});
```

{'fraction_non_alphanumeric': 0.1467828418230563, 'fraction_numerical': 0.01876675603217158, 'mean_word_length': 3.8982494529540483, 'pattern_counts': {'":': 8, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5020764', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1355, 'n_words': 435}