Home

Awesome

version build size

Dockerized Ungoogled Chromium in headless remote debugging mode.

Usage

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

Example using Puppeteer:

import puppeteer from 'puppeteer'
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