
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
docker-chromium
Advanced tools
Node library for controlling a Chromium instance running in a Docker container
Node library for controlling a Chromium instance running in a Docker container
Requirements:
npm install --save docker-chromium
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();
})();
Default is trying to connect to Chromium 5 times with a 500 milisecond interval between each attempt. You can customize timeout/attempts by passing arguments to dockerRunChromium:
// ...
const webSocketUri = await dockerRunChromium({
maxAttempts: 10,
retryInterval: 5000 // 5 seconds
});
Or by defining environment variables DOCKER_CHROMIUM_MAX_ATTEMPTS and DOCKER_CHROMIUM_RETRY_INTERVAL. Passing arguments to dockerRunChromium takes precedence over environment variables.
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.
Due to Ubuntu 14.04 LTS transitioning to ESM support, we have had to upgrade the Ubuntu version to 18.04 LTS. The Dockerfile used in the pre-built version in Docker Hub remains on the old version. Until this is changed, we have to disable this option for the time being.
Function which is used for the configuration of Chromium, before running it with dockerRunChromium.
await dockerSetChromiumConfig({
revision: '123456',
flags: [' -–ignore-certificate-errors']
});
revision: string
flags: string[]
process.env.CHROMIUM_ADDITIONAL_ARGSdownloadHost: string
process.env.PUPPETEER_DOWNLOAD_HOST || process.env.npm_config_puppeteer_download_host || process.env.npm_package_config_puppeteer_download_host || 'https://storage.googleapis.com'$CHROMIUM_DOWNLOAD_HOST/chromium-browser-snapshots/Linux_x64/$REV/chrome-linux.zip - $CHROMIUM_DOWNLOAD_HOST describes downloadHost argumentdockerSetChromiumConfig({downloadHost: 'https://internal.service.com, revision: 99999}), it means that Chromium snapshot will be downloaded from https://internal.service.com/chromium-browser-snapshots/Linux_x64/99999/chrome-linux.zipuseClosestUbuntuMirror: boolean
process.env.USE_CLOSEST_UBUNTU_MIRROR || process.env.npm_config_use_closest_ubuntu_mirror || process.env.npm_package_config_use_closest_ubuntu_mirror|| falseFunction which is used to build and run the Docker container.
const webSocketUri = await dockerRunChromium({
maxAttempts: 10,
retryInterval: 5000
});
maxAttempts: number
retryInterval: number
Promise<string>
Function which is used to shutdown the launched Docker container.
await dockerShutdownChromium();
FAQs
Node library for controlling a Chromium instance running in a Docker container
The npm package docker-chromium receives a total of 318 weekly downloads. As such, docker-chromium popularity was classified as not popular.
We found that docker-chromium demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.