Question: Given these Node dependencies:

```
{
    "chromedriver": "^2.24.1",
    "cucumber": "^1.3.0",
    "geckodriver": "^1.1.2",
    "phantomjs-prebuilt": "^2.1.12",
    "selenium-webdriver": "^3.0.0-beta-2"
} 

```

I would like PhantomJS and Firefox to ignore SSL certificates. Here is how my browser.js looks:

```
require('geckodriver');

// main browser object
var browserHandle;

// load selenium webdriver and some rules
var webdriver = require('selenium-webdriver'), 
    By = webdriver.By, 
    until = webdriver.until;

// load phantomjs into webdriver capabilities
var phantomjs_exe = require('phantomjs-prebuilt').path;
var customPhantom = webdriver.Capabilities.phantomjs();
customPhantom.set("phantomjs.binary.path", phantomjs_exe);

webdriver.Builder()
    //.forBrowser('firefox')
    //.forBrowser('phantomjs')
    .withCapabilities(customPhantom)
    .build();

```

Any suggestions with `--ignore-ssl-errors=yes`? How can I implement it in the code? I want to use only JavaScript, rather than Java.

Answer: 
For Firefox, you can use the following code:

```
var driver = new webdriver.Builder().withCapabilities(Capabilities.firefox()
.set("acceptInsecureCerts", true)).build();

```
For Chrome browser, just need to set `Capability.ACCEPT_INSECURE_TLS_CERTS, true`. It is working for me.

```
const { Builder, By, until, Capabilities, Capability } = require('selenium-webdriver');

const capabilities = Capabilities.chrome();
capabilities.set(Capability.ACCEPT_INSECURE_TLS_CERTS, true);

this.driver = new Builder()
        .withCapabilities(capabilities)
        .forBrowser('chrome')
        .build();

```