New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nextnextools/xrom

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextnextools/xrom

Run [dockerized Chromium or Firefox in headless remote debugging mode](https://github.com/nextools/images) and return `browserWSEndpoint` needed for `puppeteer.connect()`.

  • 3.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
70K
increased by3.04%
Maintainers
1
Weekly downloads
 
Created
Source

xrom npm

Run dockerized Chromium or Firefox in headless remote debugging mode and return browserWSEndpoint needed for puppeteer.connect().

Install

$ yarn add xrom

Usage

type TRunBrowserOptions = {
  browser: 'chromium' | 'firefox',
  version: string,
  dockerUrlRoot?: string
  port?: number,
  fontsDir?: string,
  mountVolumes?: {
    from: string,
    to: string,
  }[],
  cpus?: number,
  cpusetCpus?: number[]
}

type TRunBrowserResult = {
  browserWSEndpoint: string,
  closeBrowser: () => Promise<void>,
}

runBrowser(options: TRunBrowserOptions) => Promise<TRunBrowserResult>
import { runBrowser } from 'xrom'
import puppeteer from 'puppeteer-core'

const { browserWSEndpoint } = await runBrowser({ browser: 'chromium' })
const browser = await puppeteer.connect({ browserWSEndpoint })

Overriding the docker root URL to another set of browser images

You can override the root URL to use some other set of docker images of Chromium and/or Firefox.

Make sure the final link, which is evaluated as ${dockerUrlRoot}/${browser}:${version}, points to a docker image that is valid and public.

const { browserWSEndpoint, closeBrowser } = await runBrowser({
  dockerUrlRoot: 'ghcr.io/shenato/docker-browser',
  browser: 'chromium',
  version: opts.chromiumVersion,
  fontsDir: opts.fontsDir,
})

FAQs

Package last updated on 26 Apr 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc