Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.46 KB

readme.md

File metadata and controls

38 lines (27 loc) · 1.46 KB

version build size

Dockerized Firefox in headless Marionette mode.

Usage

docker pull deepsweet/firefox-headless-remote:68
docker run -it --rm --shm-size 2g -p 2828:2828 deepsweet/firefox-headless-remote:68

Example using Foxr:

import foxr from 'foxr'

(async () => {
  try {
    const browser = await foxr.connect()
    const page = await browser.newPage()

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

Fonts

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

Related