All Projects → gwuhaolin → chrome-runner

gwuhaolin / chrome-runner

Licence: other
run chrome with nodejs in code

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to chrome-runner

Puppeteer Cluster
Puppeteer Pool, run a cluster of instances in parallel
Stars: ✭ 2,175 (+13493.75%)
Mutual labels:  headless-chrome
Ruiji.net
crawler framework, distributed crawler extractor
Stars: ✭ 220 (+1275%)
Mutual labels:  headless-chrome
capybara-chrome
Chrome driver for Capybara using Chrome's remote debugging protocol
Stars: ✭ 27 (+68.75%)
Mutual labels:  headless-chrome
Api
API that uncovers the technologies used on websites and generates thumbnail from screenshot of website
Stars: ✭ 189 (+1081.25%)
Mutual labels:  headless-chrome
Chromeless
🖥 Chrome automation made simple. Runs locally or headless on AWS Lambda.
Stars: ✭ 13,254 (+82737.5%)
Mutual labels:  headless-chrome
Pdf Bot
🤖 A Node queue API for generating PDFs using headless Chrome. Comes with a CLI, S3 storage and webhooks for notifying subscribers about generated PDFs
Stars: ✭ 2,551 (+15843.75%)
Mutual labels:  headless-chrome
Deno Puppeteer
A port of puppeteer running on Deno
Stars: ✭ 128 (+700%)
Mutual labels:  headless-chrome
puppet-master
Puppeteer as a service hosted on Saasify.
Stars: ✭ 25 (+56.25%)
Mutual labels:  headless-chrome
Puppeteer Extra
💯 Teach puppeteer new tricks through plugins.
Stars: ✭ 3,397 (+21131.25%)
Mutual labels:  headless-chrome
Puppeteer
Headless Chrome Node.js API
Stars: ✭ 75,197 (+469881.25%)
Mutual labels:  headless-chrome
Phantomas
Headless Chromium-based web performance metrics collector and monitoring tool
Stars: ✭ 2,191 (+13593.75%)
Mutual labels:  headless-chrome
Lighthousebot
Run Lighthouse in CI, as a web service, using Docker. Pass/Fail GH pull requests.
Stars: ✭ 2,251 (+13968.75%)
Mutual labels:  headless-chrome
Puppeteer Examples
Puppeteer example scripts for running Headless Chrome from Node.
Stars: ✭ 2,781 (+17281.25%)
Mutual labels:  headless-chrome
Chroxy
Headless Chrome as a Service
Stars: ✭ 172 (+975%)
Mutual labels:  headless-chrome
CrawlerSamples
This is a Puppeteer+AngleSharp crawler console app samples, used C# 7.1 coding and dotnet core build.
Stars: ✭ 36 (+125%)
Mutual labels:  headless-chrome
Doctron
Docker-powered html convert to pdf(html2pdf), html to image(html2image like jpeg,png),which using chrome(golang) kernel, add watermarks to pdf, convert pdf to images etc.
Stars: ✭ 141 (+781.25%)
Mutual labels:  headless-chrome
Serverless Chrome
🌐 Run headless Chrome/Chromium on AWS Lambda
Stars: ✭ 2,625 (+16306.25%)
Mutual labels:  headless-chrome
pythonista-chromeless
Serverless selenium which dynamically execute any given code.
Stars: ✭ 31 (+93.75%)
Mutual labels:  headless-chrome
puppeteer-lambda
Module for using Headless-Chrome by Puppeteer on AWS Lambda.
Stars: ✭ 117 (+631.25%)
Mutual labels:  headless-chrome
Taiko
A node.js library for testing modern web applications
Stars: ✭ 2,964 (+18425%)
Mutual labels:  headless-chrome

Npm Package Build Status Build Status Dependency Status Npm Downloads

chrome-runner

Run chrome with ease from node.

  • Support OSX Linux Windows system
  • Handle chrome unexpected exit and restart it
  • Opens up the browser's remote-debugging-port on an available port
  • Automatic locates a Chrome binary to launch
  • Uses a fresh Chrome profile for each launch, and cleans itself up on kill()
  • Support typescript

Use

const {Runner,launch,launchWithoutNoise,launchWithHeadless} = require('chrome-runner');
// launch a chrome, launch return a Runner instance
const runner = await launch();
// read chrome remote debugging port
runner.port;
// kill this chrome
await runner.kill();

Options

launch() method can pass options by launch({name:value}). Include:

  • port: {number} launch chrome listen on debug port, default will random a free port to use
  • chromePath: {string} chrome executable full path, default will automatic find a path according to your system. If no executable chrome find, will use env CHROME_PATH as executable full path. If all of the above way can't get a path a Error('no chrome installations found') will throw
  • chromeFlags: {Array} flags pass to chrome when start chrome, all flags can be find here
  • startupPage: {string} open page when chrome start, default is about:blank
  • shouldRestartChrome: {boole} logger to handle log from chrome-runner, interface like console, default use console
  • monitorInterval: {number} in ms, monitor chrome is alive interval, default is 500ms
  • chromeDataDir: {string} chrome data dir, default will create one in system tmp
  • disableLogging: {boolean} Controls if Chome stdout and stderr is logged to file, default is true.

Runner API

  • runner.port: get chrome remove debug port
  • runner.kill(): kill chrome and release all resource and remove temp files

Events

Runner extends EventEmitter, it will emit some events in it's lifecycle, Include:

  • chromeAlive(port): when monitor detect chrome is alive
  • chromeDead(code, signal): after monitor detect chrome is not alive
  • chromeRestarted(): after chrome unexpected exited then runner restart it
  • chromeDataDirPrepared(chromeDataDir): after runner create data dir for chrome
  • chromeDataDirRemoved(chromeDataDir): after remove successful create data dir for chrome

launchWithoutNoise

launchWithoutNoise same with launch but disables many chrome services that add noise to automated scenarios.

launchWithHeadless

launchWithHeadless same with launch but run chrome in headless mode and without noise.

more use case see unit test, API detail see d.ts

Chrome log files

After chrome launched, chrome's log and pid file will be pipe to file in chromeDataDir, Include:

  • chrome-out.log chrome info log
  • chrome-err.log chrome error log
  • chrome.pid chrome pid file

Install chrome on linux server

chrome-runner required chrome installed on your system, it easy to install on OSX and Windows, Linux server see How to install Chrome browser properly via command line?

Use Case

chrome-runner has been used in many project, e.g:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].