Giter Club home page Giter Club logo

chrome-launcher's Introduction

Chrome Launcher

This Elixir library makes launching headless Google Chrome processes with custom options easily.

Utilizes erlexec to manage processes under the hood.

Only supports OSX + Linux at this time.


Installation:

{:chrome_launcher, "~> 0.0.4"}

Usage:

{:ok, pid} = ChromeLauncher.launch([
  remote_debugging_port: 9233
])

Or in a supervisor (1.5+)

children = [
  {ChromeLauncher, [remote_debugging_port: 9222]}
]

Supervisor.start_link(children, strategy: :one_for_one)

With multiple instances in a supervisor (1.5+)

children = [
  Supervisor.child_spec({ChromeLauncher, [remote_debugging_port: 9222]}, id: :chrome_1),
  Supervisor.child_spec({ChromeLauncher, [remote_debugging_port: 9223]}, id: :chrome_2),
]

Supervisor.start_link(children, strategy: :one_for_one)

Pre 1.5

import Supervisor.Spec

children = [
  worker(ChromeLauncher, [[remote_debugging_port: 9222]], id: :chrome_1),
  worker(ChromeLauncher, [[remote_debugging_port: 9223]], id: :chrome_2),
]

Supervisor.start_link(children, strategy: :one_for_one)

Available options:

  • remote_debugging_port: Configures --remote-debugging-port=PORT flag for connecting to the chrome process.
  • flags: Flags to be passed in when starting the headless chrome process. (Overrides defaults set by :chrome_launcher)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.