All Projects → gwuhaolin → Chrome Pool

gwuhaolin / Chrome Pool

Headless chrome tabs manage pool

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Chrome Pool

Differencify
Differencify is a library for visual regression testing
Stars: ✭ 572 (+1330%)
Mutual labels:  headless-chrome
Libfastcommon
c common functions library extracted from my open source project FastDFS. this library is very simple and stable. functions including: string, logger, chain, hash, socket, ini file reader, base64 encode / decode, url encode / decode, fast timer, skiplist, object pool etc. detail info please see the c header files.
Stars: ✭ 739 (+1747.5%)
Mutual labels:  connection-pool
Navalia
A bullet-proof, fast, and reliable headless browser API
Stars: ✭ 950 (+2275%)
Mutual labels:  headless-chrome
Chromy
Chromy is a library for operating headless chrome. 🍺🍺🍺
Stars: ✭ 593 (+1382.5%)
Mutual labels:  headless-chrome
Docker Puppeteer
A minimal Docker image for Puppeteer
Stars: ✭ 656 (+1540%)
Mutual labels:  headless-chrome
Url To Pdf Api
Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
Stars: ✭ 6,544 (+16260%)
Mutual labels:  headless-chrome
Headless Chrome Crawler
Distributed crawler powered by Headless Chrome
Stars: ✭ 5,129 (+12722.5%)
Mutual labels:  headless-chrome
Puppeteer Sharp Extra
Plugin framework for PuppeteerSharp
Stars: ✭ 39 (-2.5%)
Mutual labels:  headless-chrome
Browserless
A browser driver on top of puppeteer, ready for production scenarios.
Stars: ✭ 664 (+1560%)
Mutual labels:  headless-chrome
Minimal Chrome On Heroku
Getting headless chrome running on heroku
Stars: ✭ 12 (-70%)
Mutual labels:  headless-chrome
Rendertron
A Headless Chrome rendering solution
Stars: ✭ 5,593 (+13882.5%)
Mutual labels:  headless-chrome
Try Puppeteer
Run Puppeteer code in the cloud
Stars: ✭ 642 (+1505%)
Mutual labels:  headless-chrome
Nexer
Content based network multiplexer or redirector made with love and Go
Stars: ✭ 7 (-82.5%)
Mutual labels:  connection-pool
Hibernate Springboot
Collection of best practices for Java persistence performance in Spring Boot applications
Stars: ✭ 589 (+1372.5%)
Mutual labels:  connection-pool
Prerender Alpine
Lightweight Prerender container built on Alpine Linux with Node and Headless Chrome
Stars: ✭ 38 (-5%)
Mutual labels:  headless-chrome
Puppeteer Lambda Starter Kit
Starter Kit for running Headless-Chrome by Puppeteer on AWS Lambda.
Stars: ✭ 563 (+1307.5%)
Mutual labels:  headless-chrome
Cuprite
Headless Chrome/Chromium driver for Capybara
Stars: ✭ 743 (+1757.5%)
Mutual labels:  headless-chrome
Gowitness
🔍 gowitness - a golang, web screenshot utility using Chrome Headless
Stars: ✭ 996 (+2390%)
Mutual labels:  headless-chrome
Pgpool
A PosgreSQL client that automatically uses connection pools and handles reconnections in case of errors.
Stars: ✭ 38 (-5%)
Mutual labels:  connection-pool
Flexy Pool
FlexyPool adds metrics and failover strategies to a given Connection Pool, allowing it to resize on demand.
Stars: ✭ 856 (+2040%)
Mutual labels:  connection-pool

Npm Package Build Status Dependency Status Npm Downloads

chrome-pool

Headless chrome tabs manage pool, concept come from database connection pool for reuse chrome tab improve performance.

Use

1. install from npm by npm i chrome-pool

2. start ChromePool:

const ChromePool = require('chrome-pool');

const chromePoll = await ChromePool.new(options);
await chromePoll.destroyPoll();

await ChromePool.new() will make a new ChromePool and start a new chrome. A ChromePool means a chrome.

static method new() support options:

  • maxTab: {number} max tab to render pages, default is no limit.
  • port: {number} chrome debug port, default is random a free port.
  • chromeRunnerOptions: {object} options from chrome-runner and will pass to chrome-runner when launch chrome
  • protocols: {array} require chrome devtool protocol to be enable before use. e.g ['Network','Log'].

await chromePoll.destroyPoll() can release all resource used by this pool, kill chrome.

3. require a tab to use:

// require a free tab from pool to use
const { tabId,protocol } = await chromePoll.require();
// tabId
const { Page,Target,Network,...} = protocol;

await chromePoll.require() will return a object with prop:

  • tabId: chrome tab id.
  • protocol: chrome remote control protocol.

4. use protocol to control tab:

const { Page,Target,Network,...} = protocol;

protocol detail use see chrome-devtools-protocol doc. all protocol required be enable before use has been enable by chrome-pool.

5. after use a tab release it to pool:

await chromePoll.release(tabId);

release will release all resource used by this tab include removeAllListeners, so you don't need to removeListener by yourself. By default release will navigate tab to about:blank to reduce chrome resource use, you can close this feature by call chromePoll.release(tabId,false)

6. show chrome

In dev time, you may want to know what chrome are doing rather than let chrome run in headless. You can set env SHOW_CHROME=true when run your nodejs app to disable headless to debug chrome.

see test for more use case.

Notice chrome 59+ must install on you system

Friends

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].