/chromedriver-proxy

ChromeDriver Proxy is an extensible proxy to ChromeDriver.

Primary LanguageJavaScriptMIT LicenseMIT

npm version

Chromedriver-Proxy is an extensible proxy to ChromeDriver.

Features

  • Reuse browsers. The browser will be cleaned between each selenium session.
  • Connect to Chromedriver from remote host without modifying the whitelist
  • Record video and upload the video to s3. Compatible with chrome in headless mode.
  • Support mp4, webm, and m3u8 video format
  • Set extra headers
  • Evaluate script on each page load
  • Provide your own custom extensions.

Requirements

nodejs >= 8, ffmpeg, chrome >= 64 and the current version of chromedriver.

Usage

DEBUG=chromedriver_proxy:* chromedriver-proxy --config config.json

example configuration:

{
  "tmpDir": "/tmp",
  "proxy": {
    "port": 4444,
    "baseUrl": "/wd/hub"
  },
  "chromedriver": {
    "chromedriverPath": "/usr/bin/chromedriver",
    "port": 4445,
    "autoRestart": true // restart chromedriver if it crashes
  },
  "chromePool": {
    "enable": true,
    "chromePath": "/usr/bin/google-chrome",
    "reuse": true, // reuse the browser instances
    "chromeStartupTimeOut": 1000, // time to wait for chrome to startup
    // chromeAgentModule should extend the builtin ChromeAgent.
    "chromeAgentModule": "path to custom module",
    "clearStorage": [
    // https://chromedevtools.github.io/devtools-protocol/tot/Storage/#method-clearDataForOrigin
      {
        "origin": ".ziprecruiter.com",
        "storageTypes": "cookies,localstorage"
      }
    ],
    "chromeAgent": {
      "screenRecorder": {
        "videoFormat": "<mp4 or webm>",

        "s3": {
          "region": "<my region>"
          // additional options to the constructor http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#constructor-property
        },
        "s3Upload": {
          "Bucket": "<my bucket>"
          // additional options to the upload function http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property
        }
      }
    }
  }
}

Clients

The project provides a python client and a javascript client. See the examples for basic usage.

Feel free to add support for any of the languages that the selenium project supports (java, python, javascript, c#, ruby).

Issues

Please report any issues using the ChromeDriver Proxy issue tracker. When using the issue tracker

  • Do include a detailed description of the problem.
  • Do include a link to a gist with any interesting stack traces/logs (you may also attach these directly to the bug report).
  • Do include a reduced test case.
  • Do not use the issue tracker to submit basic help requests.
  • Do not post empty "I see this too" or "Any updates?" comments. These provide no additional information and clutter the log.
  • Do not report regressions on closed bugs as they are not actively monitored for updates (especially bugs that are >6 months old). Please open a new issue and reference the original bug in your report.

License

Copyright (c) 2017 ZipRecruiter

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.