Skip to content
🐳 Dockerized Chromium in headless remote debugging mode
Makefile Dockerfile Shell
Branch: master
Clone or download
Latest commit 02892b2 Oct 26, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile ♻️ update to Chromium 77.0.3865.90 Oct 26, 2019
Makefile πŸ›  refactor Makefile Oct 26, 2019
entrypoint.sh πŸ›  support extra Chromium flags passed to entrypoint Sep 14, 2019
license.md
readme.md

readme.md

version hub size

Dockerized Chromium in headless remote debugging mode.

Usage

docker pull deepsweet/chromium-headless-remote:77
docker run -it --rm -p 9222:9222 deepsweet/chromium-headless-remote:77

Example using Puppeteer:

Ensure to match version of puppeteer-core to the version of Chromium you are using:

npm install puppeteer-core@chrome-77
import puppeteer from 'puppeteer-core'
import request from 'request-promise-native'

(async () => {
  try {
    const { body: { webSocketDebuggerUrl } } = await request({
      uri: 'http://localhost:9222/json/version',
      json: true,
      resolveWithFullResponse: true
    })
    const browser = await puppeteer.connect({
      browserWSEndpoint: webSocketDebuggerUrl
    })
    const page = await browser.newPage()

    await page.goto('https://example.com')
    await page.screenshot({ path: 'example.png' })
    await browser.close()
  } catch (err) {
    console.error(err)
  }
})()

Fonts

It's possible to mount a folder with custom fonts to be used later by Chromium: add -v $(pwd)/path/to/fonts:/home/chromium/.fonts to docker run arguments.

Related

You can’t perform that action at this time.