Node library for controlling a Chromium instance running in a Docker container
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docker
lib
src
tests
.editorconfig
.eslintrc
.gitattributes
.gitignore
.travis.yml
LICENSE
README.md
jest.config.js
package-lock.json
package.json

README.md

docker-chromium

Build Status Node library for controlling a Chromium instance running in a Docker container

NPM

Installation

Requirements:

npm install --save docker-chromium

Basic Usage

const {
    dockerSetChromiumConfig,
    dockerRunChromium,
    dockerShutdownChromium
} = require("docker-chromium");

(async () => {
    await dockerSetChromiumConfig({
        revision: "123456"
        flags: [' -–ignore-certificate-errors']
    });
    const webSocketUri = await dockerRunChromium();
    // do some other stuff...
    await dockerShutdownChromium();
})();

How it works

docker-chromium pulls a pre-built Docker image running a version of Chromium specified by you from a Docker Hub repository. You can then fetch the WebSocket URI to connect to the instance in your own application. If the pre-built image is unavailable or corrupt (rare case), a backup mechanism is in place, which builds the image from scratch locally instead.