Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chrome-pool

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrome-pool

headless chrome tabs manage pool

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-81.08%
Maintainers
1
Weekly downloads
 
Created
Source

Npm Package Npm Downloads Dependency Status

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();
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.

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

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

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

  • tabId: chrome tab id.

  • protocol: chrome remote control protocol.

  1. use protocol to control tab:
const { Page,Target,Network,...} = protocol;

protocol detail use see chrome-devtools-protocol doc.

  1. after use a tab release it to pool:
await chromeTabsPoll.release(tabId);

see test for more use case.

Dependencies

  1. Chrome 59+ should install on you system
  2. Nodejs 7+

Friends

Keywords

FAQs

Package last updated on 14 Jun 2017

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